OpenGL ES 2.0 / GLSL 1.0
-
Reading Pixels
//*Reading Pixels [4.3.1]
#highlight(c){{
void ReadPixels(int x, int y, sizei width, sizei height, enum format, enum type, void *data);
//format: RGBA type: UNSIGNED_BYTE
}}
&bold(){Note:} &bold(){ReadPixels()} also accepts a queriable implementationdefined format/type combination, see [4.3.1].
http://www22.atwiki.jp/opengles/pages/27.html
OpenGL ES 2.0 / GLSL 1.0
-
Texturing
// *Texturing [3.7]
Shaders support texturing using at least MAX_VERTEX_TEXTURE_IMAGE_UNITS images for vertex shaders and at least MAX_TEXTURE_IMAGE_UNITS images for fragment shaders.
#highlight(c){{
void ActiveTexture(enum texture);
// texture: [TEXTURE0..TEXTUREi] where i = MAX_COMBINED_TEXTURE_IMAGE_UNITS-1
}}
**Texture Image Specification [3.7.1]
#highlight(c){{
void TexImage2D(enum target, int level, int internalformat, sizei width, sizei height, int border, enum format, enum type, void *data);
// target: TEXTURE_2D, TEXTURE_CUBE_MAP_POSITIVE_{X,Y,Z}, TEXTURE_CUBE_MAP_NEGATIVE_{X,Y,Z}
// internalformat: ALPHA, LUMINANCE, LUMINANCE_ALPHA, RGB, RGBA
// format: ALPHA, RGB, RGBA, LUMINANCE, LUMINANCE_ALPHA
// type: UNSIGNED_BYTE, UNSIGNED_SHORT_5_6_5, UNSIGNED_SHORT_4_4_4_4, UNSIGNED_SHORT_5_5_5_1
}}
Conversion from RGBA pixel components to internal texture components:
|&bold(){Base Internal Format}|&bold(){RGBA}|&bold(){Internal Components}|
|ALPHA|A|A|
|LUMINANCE|R|L|
|LUMINANCE_ALPHA|R, A|L, A|
|RGB|R, G, B|R, G, B|
|RGBA|R, G, B, A|R, G, B, A|
**Alt. Texture Image Specification Commands [3.7.2]
Texture images may also be specified using image data taken
directly from the framebuffer, and rectangular subregions of
existing texture images may be respecified.
#highlight(c){{
void CopyTexImage2D(enum target, int level, enum internalformat, int x, int y, sizei width, sizei height, int border);
// target: TEXTURE_2D, TEXTURE_CUBE_MAP_POSITIVE_{X, Y, Z}, TEXTURE_CUBE_MAP_NEGATIVE_{X, Y, Z}
// internalformat: See TexImage2D
}}
#highlight(c){{
void TexSubImage2D(enum target, int level, int xoffset, int yoffset, sizei width, sizei height, enum format, enum type, void *data);
// target: TEXTURE_CUBE_MAP_POSITIVE_{X, Y, Z}, TEXTURE_CUBE_MAP_NEGATIVE_{X, Y, Z}
// format and type: See TexImage2D
}}
#highlight(c){{
void CopyTexSubImage2D(enum target, int level, int xoffset, int yoffset, int x, int y, sizei width, sizei height);}}
// target: TEXTURE_2D, TEXTURE_CUBE_MAP_POSITIVE_{X, Y, Z}, TEXTURE_CUBE_MAP_NEGATIVE_{X, Y, Z}
format and type: See TexImage2D
**Compressed Texture Images [3.7.3]
#highlight(c){{
void CompressedTexImage2D(enum target, int level, enum internalformat, sizei width, sizei height, int border, sizei imageSize, void *data);
// target and internalformat: See TexImage2D
}}
#highlight(c){{
void CompressedTexSubImage2D(enum target, int level, int xoffset, int yoffset, sizei width, sizei height, enum format, sizei imageSize, void *data);
// target and internalformat: See TexImage2D
}}
**Texture Parameters [3.7.4]
#highlight(c){{
void TexParameter{if}(enum target, enum pname, T param);
void TexParameter{if}v(enum target, enum pname, T params);
// target: TEXTURE_2D, TEXTURE_CUBE_MAP
// pname: TEXTURE_WRAP_{S, T}, TEXTURE_{MIN, MAG}_FILTER
}}
**Manual Mipmap Generation [3.7.11]
#highlight(c){{
void GenerateMipmap(enum target);
// target: TEXTURE_2D, TEXTURE_CUBE_MAP
}}
**Texture Objects [3.7.13]
#highlight(c){{
void BindTexture(enum target, uint texture);
void DeleteTextures(sizei n, uint *textures);
void GenTextures(sizei n, uint *textures);
}}
**Enumerated Queries [6.1.3]
#highlight(c){{
void GetTexParameter{if}v(enum target, enum value, T data);
// target: TEXTURE_2D, TEXTURE_CUBE_MAP
// value: TEXTURE_WRAP_{S, T}, TEXTURE_{MIN, MAG}_FILTER
}}
**Texture Queries [6.1.4]
#highlight(c){{
boolean IsTexture(uint texture);
}}
http://www22.atwiki.jp/opengles/pages/28.html
OpenGL ES 2.0 / GLSL 1.0
-
Errors
// *Errors [2.5]
enum GetError( void ); //Returns one of the following:
|&bold(){INVALID_ENUM}|Enum argument out of range|
|&bold(){INVALID_FRAMEBUFFER_OPERATION}|Framebuffer is incomplete|
|&bold(){INVALID_VALUE}|Numeric argument out of range|
|&bold(){INVALID_OPERATION}|Operation illegal in current state|
|&bold(){OUT_OF_MEMORY}|Not enough memory left to execute command|
|&bold(){NO_ERROR}|No error encountered|
http://www22.atwiki.jp/opengles/pages/29.html
OpenGL ES 2.0 / GLSL 1.0
-
GL Data Types
// **GL Data Types [2.3]
GL types are not C types.
|&bold(){GL Type}|&bold(){Minimum Bit Width}|&bold(){Description}|
|boolean|1|Boolean|
|byte|8|Signed binary integer|
|ubyte|8|Unsigned binary integer|
|char|8|Characters making up strings|
|short|16|Signed 2’s complement binary integer|
|ushort|16|Unsigned binary integer|
|int|32|Signed 2’s complement binary integer|
|uint|32|Unsigned binary integer|
|fixed|32|Signed 2’s complement 16.16 scaled integer|
|sizei|32|Non-negative binary integer size|
|enum|32|Enumerated binary integer value|
|intptr|ptrbits|Signed 2’s complement binary integer|
|sizeiptr|ptrbits|Non-negative binary integer size|
|bitfield|32|Bit field|
|float|32|Floating-point value|
|clampf|32|Floating-point value clamped to [0; 1]|
http://www22.atwiki.jp/opengles/pages/30.html
OpenGL ES 2.0 / GLSL 1.0
-
Vertices
// *Vertices
**Current Vertex State [2.7]
#highlight(c){{
void VertexAttrib{1234}{f}(uint index, T values);
void VertexAttrib{1234}{f}v(uint index, T values);
}}
**Vertex Arrays [2.8]
Vertex data may be sourced from arrays that are stored in application memory (via a pointer) or faster GPU memory (in a buffer object).
#highlight(c){{
void VertexAttribPointer(uint index, int size, enum type, boolean normalized, sizei stride, const void *pointer);
// type: BYTE, UNSIGNED_BYTE, SHORT, UNSIGNED_SHORT, FIXED, FLOAT
// index: [0, MAX_VERTEX_ATTRIBS - 1]
}}
If an ARRAY_BUFFER is bound, the attribute will be read from the bound buffer, and pointer is treated as an offset within the buffer.
#highlight(c){{
void EnableVertexAttribArray(uint index);
void DisableVertexAttribArray(uint index);
// index: [0, MAX_VERTEX_ATTRIBS - 1]
void DrawArrays(enum mode, int first, sizei count);
void DrawElements(enum mode, sizei count, enum type, void *indices);
// mode: POINTS, LINE_STRIP, LINE_LOOP, LINES, TRIANGLE_STRIP, TRIANGLE_FAN, TRIANGLES
// type: UNSIGNED_BYTE, UNSIGNED_SHORT
}}
If an ELEMENT_ARRAY_BUFFER is bound, the indices will be read from the bound buffer, and indices is treated as an offset within the buffer.
http://www22.atwiki.jp/opengles/pages/31.html