You are on page 1of 10

OpenGL 4.

1 API Quick Reference Card - Page 1


OpenGL® is the only cross-platform graphics API that enables developers of software for OpenGL Command Syntax [2.3]
PC, workstation, and supercomputing hardware to create high-performance, visually- GL commands are formed from a return type, a name, and optionally up to 4 characters
compelling graphics software applications, in markets such as CAD, content creation, (or character pairs) from the Command Letters table (above), as shown by the prototype:
energy, entertainment, game development, manufacturing, medical, and virtual reality.
Specifications are available at www.opengl.org/registry return-type Name{1234}{b s i i64 f d ub us ui ui64}{v} ([args ,] T arg1 , . . . , T argN [, args]);
• see FunctionName refers to functions on this reference card.
• Content shown in blue is removed from the OpenGL 4.1 core profile and present only in the The arguments enclosed in brackets ([args ,] and [, args]) may or may not be present.
OpenGL 4.1 compatibility profile. Profile selection is made at context creation. The argument type T and the number N of arguments may be indicated by the command name
• [n.n.n] and [Table n.n] refer to sections and tables in the OpenGL 4.1 core specification. suffixes. N is 1, 2, 3, or 4 if present, or else corresponds to the type letters from the Command
• [n.n.n] and [Table n.n] refer to sections and tables in the OpenGL 4.1 compatibility profile Table (above). If “v” is present, an array of N items are passed by a pointer.
specification, and are shown only when they differ from the core profile. For brevity, the OpenGL documentation and this reference may omit the standard prefixes.
• [n.n.n] refers to sections in the OpenGL Shading Language 4.10 specification. The actual names are of the forms: glFunctionName(), GL_CONSTANT, GLtype

OpenGL Operation Command Letters [Table 2.1] Vertex Specification void FogCoord{fd}(T coord);
Letters are used in commands to denote types. void FogCoord{fd}v(const T coord);
Floating-Point Numbers [2.1.1 - 2.1.2] Begin and End [2.6]
16-Bit 1-bit sign, 5-bit exponent, b - byte (8 bits) ub - ubyte (8 bits) Enclose coordinate sets between Begin/End void Color{34}{bsifd ubusui}(T components);
10-bit mantissa s - short (16 bits) us - ushort (16 bits) pairs to construct geometric objects. void Color{34}{bsifd ubusui}v(
Unsigned 11-Bit no sign bit, 5-bit exponent, i - int (32 bits) ui - uint (32 bits) void Begin(enum mode); const T components);
6-bit mantissa void End(void); void ColorP{34}ui(enum type, uint coords);
Unsigned 10-Bit no sign bit, 5-bit exponent, i64 - int64 (64 bits) ui64 - uint64 (64 bits) mode: see MultiDrawElementsBaseVertex
Separate Patches void ColorP{34}uiv(enum type,
5-bit mantissa f - float (32 bits) d - double (64 bits) const uint *coords);
void PatchParameteri(enum pname, int value);
pname: PATCH_VERTICES void SecondaryColor3{bsifd ubusui}(
T components);
OpenGL Errors [2.5] enum GetError(void); Returns the numeric error code. Polygon Edges [2.6.2]
Flag each edge of polygon primitives as either void SecondaryColor3{bsifd ubusui}v(
boundary or non-boundary. const T components);
void EdgeFlag(boolean flag);
Vertex Arrays [2.8] void ArrayElement(int i);
void EdgeFlagv(const boolean *flag);
void SecondaryColorP3ui(enum type,
uint coords);
void VertexPointer(int size, enum type, Enable/Disable(PRIMITIVE_RESTART)
sizei stride, const void *pointer); void PrimitiveRestartIndex(uint index); Vertex Specification [2.7] void SecondaryColorP3uiv(enum type,
type: SHORT, INT, FLOAT, HALF_FLOAT, DOUBLE, Vertices have 2, 3, or 4 coordinates, and const uint *coords);
{UNSIGNED_}INT_2_10_10_10_REV Drawing Commands [2.8.3] [2.8.2] optionally a current normal, multiple current
void Index{sifd ub}(T index);
void DrawArrays(enum mode, int first, texture coordinate sets, multiple current
void NormalPointer(enum type, sizei stride, sizei count); generic vertex attributes, current color, current void Index{sifd ub}v(const T index);
const void *pointer); secondary color, and current fog coordinates.
type: see VertexPointer, plus BYTE void DrawArraysInstanced(enum mode, The VertexAttrib* commands specify generic
int first, sizei count, sizei primcount}; void Vertex{234}{sifd}(T coords); attributes with components of type float
void ColorPointer(int size, enum type,
sizei stride, const void *pointer); void DrawArraysIndirect(enum mode, void Vertex{234}{sifd}v(const T coords); (VertexAttrib*), int or uint (VertexAttribI*), or
type: see VertexPointer, plus BYTE, UINT, const void *indirect); double (VertexAttribL*d*).
void MultiDrawArrays(enum mode, void VertexP{234}ui(enum type, uint coords); void VertexAttrib{1234}{sfd}(uint index,
UNSIGNED_{BYTE, SHORT}
void SecondaryColorPointer(int size, const int *first, sizei *count, void VertexP{234}uiv(enum type, T values);
enum type, sizei stride, const void *pointer); const sizei primcount); const uint *coords); void VertexAttrib{123}{sfd}v(uint index,
type: see ColorPointer void DrawElements(enum mode, type: INT_2_10_10_10_REV, const T values);
sizei count, enum type, const void *indices); UNSIGNED_INT_2_10_10_10_REV
void IndexPointer(enum type, sizei stride, void VertexAttrib4{bsifd ub us ui}v(
const void *pointer); void DrawElementsInstanced(enum mode, void TexCoord{1234}{sifd}(T coords); uint index, const T values);
type: UNSIGNED_BYTE, SHORT, INT, FLOAT, DOUBLE sizei count, enum type, const void *indices, void TexCoord{1234}{sifd}v(const T coords); void VertexAttrib4Nub(uint index, T values);
void EdgeFlagPointer(sizei stride, sizei primcount); void TexCoordP{1234}ui(enum type,
const void *pointer); void MultiDrawElements(enum mode, void VertexAttrib4N{bsi ub us ui}v(
uint coords); uint index, const T values);
void FogCoordPointer(enum type, sizei *count, enum type,
sizei stride, const void *pointer); const void **indices, sizei primcount); void TexCoordP{1234}uiv(enum type, void VertexAttribI{1234}{i ui}(uint index,
const uint *coords); T values);
type: FLOAT, HALF_FLOAT, DOUBLE void DrawRangeElements(enum mode, type: see VertexP{234}uiv
void TexCoordPointer(int size, enum type, uint start, uint end, sizei count, void VertexAttribI{1234}{i ui}v(uint index,
sizei stride, const void *pointer); enum type, const void *indices); void MultiTexCoord{1234}{sifd}( const T values);
type: see VertexPointer void DrawElementsBaseVertex(enum mode, enum texture, T coords); void VertexAttribI4{bs ub us}v(uint index,
void VertexAttribPointer(uint index, int size, sizei count, enum type, const void *indices, void MultiTexCoord{1234}{sifd}v( const T values);
enum type, boolean normalized, int basevertex); enum texture, const T coords); void VertexAttribP{1234}ui(
sizei stride, const void *pointer); void DrawRangeElementsBaseVertex( texture: TEXTUREi (where i is uint index, enum type, boolean normalized,
type: see ColorPointer, plus FIXED enum mode, uint start, uint end, [0, MAX_TEXTURE_COORDS - 1]) uint value)
void VertexAttribIPointer(uint index, sizei count, enum type, const void *indices, void MultiTexCoordP{1234}ui(enum texture, void VertexAttribL{1234}d(uint index,
int size, enum type, sizei stride, int basevertex); enum type, uint coords); T values);
const void *pointer); void DrawElementsInstancedBaseVertex( void MultiTexCoordP{1234}uiv(
type: BYTE, SHORT, UNSIGNED_{BYTE, SHORT}, INT, UINT enum mode, sizei count, enum type, void VertexAttribL{1234}dv(uint index,
enum texture, enum type, const uint *coords); T values);
index: [0, MAX_VERTEX_ATTRIBS - 1] const void *indices, sizei primcount,
void VertexAttribLPointer(uint index, int size, int basevertex); void Normal3{bsifd}(const T coords); void VertexAttribP{1234}uiv(uint index,
enum type, sizei stride, const void *pointer); void DrawElementsIndirect(enum mode, void Normal3{bsifd}v(T coords); enum type, boolean normalized,
type: DOUBLE enum type, const void *indirect); const uint *value);
void NormalP3ui(enum type, uint normal); type: see VertexP{234}uiv
index: see VertexAttribIPointer void MultiDrawElementsBaseVertex(
void EnableClientState(enum array); void NormalP3uiv(enum type, uint *normal);
enum mode, sizei *count, enum type,
void DisableClientState(enum array); const void **indices, sizei primcount,
array: {VERTEX, NORMAL, COLOR, INDEX}_ARRAY, int *basevertex);
mode: POINTS, LINE_STRIP, LINE_LOOP, LINES, Mapping/Unmapping Buffer Data [2.9.3] void BindVertexArray(uint array);
{SECONDARY_COLOR, EDGE_FLAG}_ARRAY, void *MapBufferRange(enum target,
FOG_COORD_ARRAY, TEXTURE_COORD_ARRAY POLYGON, TRIANGLE_{STRIP, FAN}, TRIANGLES, Buffer Object Queries [6.1.9] [6.1.15]
QUAD_STRIP, QUADS, LINES_ADJACENCY, intptr offset, sizeiptr length, bitfield access); boolean IsBuffer(uint buffer);
void EnableVertexAttribArray(uint index); {LINE, TRIANGLE}_STRIP_ADJACENCY, access: The logical OR of MAP_{READ, WRITE}_BIT,
void DisableVertexAttribArray(uint index); PATCHES, TRIANGLES_ADJACENCY, MAP_INVALIDATE_{BUFFER, RANGE}_BIT, void GetBufferParameteriv(enum target,
index: [0, MAX_VERTEX_ATTRIBS - 1] type: UNSIGNED_{BYTE, SHORT, INT} MAP_{FLUSH_EXPLICIT, UNSYNCHRONIZED}_BIT, enum pname, int *data);
target: see BindBuffer target: see BindBuffer
void VertexAttribDivisor(uint index, void InterleavedArrays(enum format, pname: BUFFER_SIZE, BUFFER_USAGE,
uint divisor); sizei stride, const void *pointer); void *MapBuffer(enum target, enum access); BUFFER_ACCESS{_FLAGS}, BUFFER_MAPPED,
void ClientActiveTexture(enum texture); format: V2F, V3F, C4UB_{V2F, V3F}, {C3F, N3F}_V3F, access: READ_ONLY, WRITE_ONLY, READ_WRITE BUFFER_MAP_{OFFSET, LENGTH}
index: TEXTUREi (where i is [0, MAX_TEXTURE_COORDS - 1]) C4F_N3F_V3F, T2F_{C4UB, C3F, N3F}_V3F, void FlushMappedBufferRange(
T2F_V3F, T4F_V4F, T2F_C4F_N3F_{V3F, V4F} void GetBufferParameteri64v(enum target,
enum target, intptr offset, sizeiptr length); enum pname, int64 *data);
target: see BindBuffer target: see BindBuffer
pname: see GetBufferParameteriv,
Buffer Objects [2.9] void BindBufferBase(enum target,
uint index, uint buffer);
boolean UnmapBuffer(enum target);
target: see BindBuffer
void GenBuffers(sizei n, uint *buffers); void GetBufferSubData(enum target,
target: see BindBufferRange Copying Between Buffers [2.9.5] intptr offset, sizeiptr size, void *data);
void DeleteBuffers(sizei n, const uint *buffers);
Creating Buffer Object Data Stores [2.9.2] void *CopyBufferSubData(enum readtarget, target: see BindBuffer
Creating and Binding Buffer Objects [2.9.1] void BufferData(enum target, sizeiptr size, enum writetarget, intptr readoffset,
void BindBuffer(enum target, uint buffer); void GetBufferPointerv(enum target,
const void *data, enum usage); intptr writeoffset, sizeiptr size); enum pname, void **params);
target: PIXEL_{PACK, UNPACK}_BUFFER, UNIFORM_BUFFER usage: STREAM_{DRAW, READ, COPY}, readtarget and writetarget: see BindBuffer
ARRAY_BUFFER, COPY_{READ, WRITE}_BUFFER, target: see BindBuffer
{DYNAMIC, STATIC}_{DRAW, READ, COPY} Vertex Array Objects [2.10] pname: BUFFER_MAP_POINTER
DRAW_INDIRECT_BUFFER, ELEMENT_ARRAY_BUFFER, target: see BindBuffer
TEXTURE_BUFFER, TRANSFORM_FEEDBACK_BUFFER, All states related to definition of data used by
void BufferSubData(enum target, vertex processor is in a vertex array object. Vertex Array Object Queries
void BindBufferRange(enum target, uint index, intptr offset, sizeiptr size, [6.1.10] [6.1.16]
uint buffer, intptr offset, sizeiptr size); void GenVertexArrays(sizei n, uint *arrays);
target: {TRANSFORM_FEEDBACK, UNIFORM}_BUFFER
const void *data); void DeleteVertexArrays(sizei n, boolean IsVertexArray(uint array);
target: see BindBuffer const uint *arrays);
©2010 Khronos Group - Rev. 0610 www.opengl.org/registry
OpenGL 4.1 API Quick Reference Card - Page 2
Rectangles, Matrices, Texture void Rotate{fd}(Ty, T x, T y, T z); Rendering Control & Queries void DrawTransformFeedback(
enum mode, uint id);
Coordinates void Translate{fd}(T x, T y, T z); Asynchronous Queries [2.15] [2.18]
void DrawTransformFeedbackStream(
void Scale{fd}(T x, T y, T z); void BeginQuery(enum target, uint id);
Rectangles [2.11] target: PRIMITIVES_GENERATED{n}, enum mode, uint id, uint stream);
Specifiy rectangles as two corner vertices. void Frustum(double l, double r, double b, {ANY_}SAMPLES_PASSED, TIME_ELAPSED,
void Rect{sifd}(T x1, T y1, T x2, T y2); double t, double n, double f); TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN{n} Transform Feedback Query
void EndQuery(enum target); [6.1.11] [6.1.17]
void Rect{sifd}v(const T v1[2], const T v2[2]); void Ortho(double l, double r, double b,
double t, double n, double f); boolean IsTransformFeedback(uint id);
void BeginQueryIndexed(enum target, uint
Matrices [2.12.1] void PushMatrix(void); index, uint id); Current Raster Position [2.25]
void MatrixMode(enum mode); void EndQueryIndexed(enum target, void RasterPos{234}{sifd}(T coords);
mode: TEXTURE, MODELVIEW, COLOR, PROJECTION void PopMatrix(void);
uint index); void RasterPos{234}{sifd}v(const T coords);
void LoadMatrix{fd}(const T m[16]); Texture Coordinates [2.12.3] void GenQueries(sizei n, uint *ids);
void TexGen{ifd}(enum coord, enum pname, void WindowPos{23}{sifd}(T coords);
void MultMatrix{fd}(const T m[16]); void DeleteQueries(sizei n, const uint *ids);
T param); void WindowPos{23}{sifd}v(const T coords);
void LoadTransposeMatrix{fd}(const T m[16]); Conditional Rendering [2.16] [2.19]
void TexGen{ifd}v(enum coord,
void MultTransposeMatrix{fd}(const T m[16]); enum pname, const T params); void BeginConditionalRender(uint id, Asynchronous Queries [6.1.7] [6.1.13]
coord: S, T, R, Q enum mode); boolean IsQuery(uint id);
void LoadIdentity(void); mode: QUERY_WAIT, QUERY_NO_WAIT,
pname: TEXTURE_GEN_MODE, {OBJECT, EYE}_PLANE QUERY_BY_REGION_{WAIT, NO_WAIT} void GetQueryiv(enum target,
enum pname, int *params);
void EndConditionalRender(void); target: see BeginQuery, plus TIMESTAMP
Lighting and Color const T params);
pname: LIGHT_MODEL_{AMBIENT, LOCAL_VIEWER}, Transform Feedback [2.17] [2.20]
pname: CURRENT_QUERY, QUERY_COUNTER_BITS
Enable/Disable(LIGHTING) // generic enable LIGHT_MODEL_{TWO_SIDE, COLOR_CONTROL} void GenTransformFeedbacks(sizei n, uint *ids); void GetQueryIndexediv(enum target,
uint index, enum pname, int *params);
Enable/Disable(LIGHTi) // indiv. lights ColorMaterial [4.3.1] [2.13.3, 3.7.5] void DeleteTransformFeedbacks(sizei n, target: see BeginQuery
Enable/Disable(COLOR_MATERIAL) const uint *ids); pname: CURRENT_QUERY, QUERY_COUNTER_BITS
Lighting Parameter Spec. [2.13.2] void BindTransformFeedback(
void Material{if}(enum face, void ColorMaterial(enum face, enum mode); void GetQueryObjectiv(uint id,
face: FRONT, BACK, FRONT_AND_BACK
enum target, uint id); enum pname, int *params);
enum pname, T param); target: TRANSFORM_FEEDBACK
mode: EMISSION, AMBIENT, DIFFUSE, SPECULAR, void GetQueryObjectuiv(uint id,
void Material{if}v(enum face, AMBIENT_AND_DIFFUSE void BeginTransformFeedback( enum pname, uint *params);
enum pname, const T params); enum primitiveMode);
void ClampColor(enum target, enum clamp); primitiveMode: TRIANGLES, LINES, POINTS void GetQueryObjecti64v(uint id,
face: FRONT, BACK, FRONT_AND_BACK target: CLAMP_VERTEX_COLOR
pname: AMBIENT, DIFFUSE, AMBIENT_AND_DIFFUSE, void EndTransformFeedback(void); enum pname, int64 *params);
clamp: TRUE, FALSE, FIXED_ONLY
EMISSION, SHININESS, COLOR_INDEXES, SPECULAR void GetQueryObjectui64v(uint id,
void PauseTransformFeedback(void);
void Light{if}(enum light, enum pname, Flatshading [2.19] [2.22] enum pname, uint64 *params);
void ProvokingVertex(enum provokeMode); void ResumeTransformFeedback(void); pname: QUERY_RESULT{_AVAILABLE}
T param);
provokeMode: {FIRST, LAST}_VERTEX_CONVENTION
void Light{if}v(enum light, enum pname, void ShadeModel(enum mode);
const T params);
light: LIGHTi (where i >= 0)
mode: SMOOTH, FLAT Viewport and Clipping void ViewportIndexedfv(uint index,
const float *v);
pname: AMBIENT, DIFFUSE, SPECULAR,POSITION, Queries [6.1.3] Controlling Viewport [2.14.1] [2.17.1] void Viewport(int x, int y, sizei w, sizei h);
SPOT_{DIRECTION, EXPONENT, CUTOFF}, void GetLight{if}v(enum light, enum value, void DepthRangeArrayv(uint first,
{CONSTANT, LINEAR,QUADRATIC}_ATTENUATION T data); sizei count, const clampd *v); Clipping [2.20] [2.23, 6.1.3]
void GetMaterial{if}v(enum face, void DepthRangeIndexed(uint index, Enable/Disable(CLIP_DISTANCEi)
void LightModel{if}(enum pname, T param); enum value, T data); clampd n, clampd f); i: [0, MAX_CLIP_DISTANCES - 1]
void LightModel{if}v(enum pname, face: FRONT, BACK void DepthRange(clampd n, clampd f); void ClipPlane(enum p, const double eqn[4]);
void DepthRangef(clampf n, clampd f); p: CLIP_PLANEi (where i is [0, MAX_CLIP_PLANES - 1])
void ViewportArrayv(uint first, sizei count, void GetClipPlane(enum plane,
Shaders and Programs void ActiveShaderProgram(uint pipeline,
uint program);
const float *v);
void ViewportIndexedf(uint index, float x, double eqn[4]);
Shader Objects [2.11.1-2] [2.14.1-2] float y, float w, float h);
uint CreateShader(enum type); Program Binaries [2.11.5] [2.14.5]
type: {VERTEX, FRAGMENT, GEOMETRY}_SHADER, void GetProgramBinary(uint program,
TESS_{EVALUATION, CONTROL}_SHADER
sizei bufSize, sizei *length, void GetUniformIndices(uint program, void ProgramUniform{1234}{ifd}(
void ShaderSource(uint shader, sizei count, enum *binaryFormat, void *binary); sizei uniformCount, uint program, int location, T value);
const char **string, const int *length); const char **uniformNames, void ProgramUniform{1234}{ifd}v(
void ProgramBinary(uint program, uint *uniformIndices);
void CompileShader(uint shader); enum binaryFormat, const void *binary, uint program, int location, sizei count,
sizei length); void GetActiveUniformName( const T value);
void ReleaseShaderCompiler(void);
uint program, uint uniformIndex, void ProgramUniform{1234}ui(
void DeleteShader(uint shader); Vertex Attributes [2.11.6] [2.14.6] sizei bufSize, sizei *length, uint program, int location, T value);
void ShaderBinary(sizei count, Vertex shaders operate on array of 4-component char *uniformName); void ProgramUniform{1234}uiv(
const uint *shaders, enum binaryformat, items numbered from slot 0 to void GetActiveUniform(uint program, uint program, int location, sizei count,
const void *binary, sizei length); MAX_VERTEX_ATTRIBS - 1. uint index, sizei bufSize, sizei *length, const T value);
void GetActiveAttrib(uint program, int *size, enum *type, char *name); void ProgramUniformMatrix{234}{fd}v(
Program Objects [2.11.3] [2.14.3] uint index, sizei bufSize, sizei *length, *type returns: DOUBLE, DOUBLE_{VECn, MATn, uint program, int location, sizei count,
uint CreateProgram(void); int *size, enum *type, char *name); MATnxn}, FLOAT, FLOAT_{VECn, MATn, MATnxn}, boolean transpose, const float *value);
void AttachShader(uint program, *type returns: FLOAT, FLOAT_{VECn, MATn, MATnxm}, INT, INT_VECn, UNSIGNED_INT{_VECn}, BOOL, void ProgramUniformMatrixf{2x3,3x2,2x4,
uint shader); INT, INT_VECn, UNSIGNED_{INT, INT_VECn} BOOL_VECn, and the SAMPLER_* and 4x2,3x4,4x3}{fd}v(
{UNSIGNED_}INT_SAMPLER_* values in uint program, int location, sizei count,
void DetachShader(uint program, int GetAttribLocation(uint program, [Table 2.13] [Table 2.16]
uint shader); boolean transpose, const float *value);
const char *name); void GetActiveUniformsiv(uint program,
void LinkProgram(uint program); Uniform Buffer Object Bindings
void BindAttribLocation(uint program, sizei uniformCount, const uint void UniformBlockBinding(uint program,
void UseProgram(uint program); uint index, const char *name); *uniformIndices, enum pname, uint uniformBlockIndex,
uint CreateShaderProgramv(enum type, int *params); uint uniformBlockBinding);
sizei count, const char **strings); Uniform Variables [2.11.7] [2.14.7] pname: UNIFORM_{TYPE, SIZE, NAME_LENGTH},
UNIFORM_BLOCK_INDEX, UNIFORM_OFFSET, Subroutine Uniform Variables
void ProgramParameteri(uint program, int GetUniformLocation(uint program, [2.11.8] [2.14.8]
const char *name); UNIFORM_{ARRAY, MATRIX}_STRIDE,
enum pname, int value); UNIFORM_IS_ROW_MAJOR int GetSubroutineUniformLocation(
pname: PROGRAM_SEPARABLE, uint GetUniformBlockIndex(uint program, uint program, enum shadertype,
PROGRAM_BINARY_{RETRIEVABLE_HINT}, const char *uniformBlockName); Load Uniform Vars. In Default Uniform Block const char *name);
value: TRUE, FALSE void Uniform{1234}{ifd}(int location, uint GetSubroutineIndex(uint program,
void DeleteProgram(uint program); void GetActiveUniformBlockName( T value); enum shadertype, const char *name);
uint program, uint uniformBlockIndex, void GetActiveSubroutineUniformiv(
sizei bufSize, sizei *length, void Uniform{1234}{ifd}v(int location, uint program, enum shadertype,
Program Pipeline Objects [2.11.4] [2.14.4] char *uniformBlockName); sizei count, const T value);
void GenProgramPipelines(sizei n, uint index, enum pname, int *values);
uint *pipelines); void GetActiveUniformBlockiv(uint void Uniform{1234}ui(int location, T value); pname: {NUM_}COMPATIBLE_SUBROUTINES,
program, UNIFORM_SIZE, UNIFORM_NAME_LENGTH
void DeleteProgramPipelines(sizei n, uint uniformBlockIndex, enum pname, void Uniform{1234}uiv(int location,
sizei count, const T value); void GetActiveSubroutineUniformName(
const uint *pipelines); int *params); uint program, enum shadertype,
void BindProgramPipeline(uint pipeline); pname: UNIFORM_BLOCK_{BINDING, DATA_SIZE}, void UniformMatrix{234}{fd}v( uint index, sizei bufsize, sizei *length,
UNIFORM_BLOCK_NAME_{LENGTH, UNIFORM}, int location, sizei count, char *name);
void UseProgramStages(uint pipeline, UNIFORM_BLOCK_ACTIVE_UNIFORMS_INDICES, boolean transpose, const T *value);
bitfield stages, uint program); void GetActiveSubroutineName(
stages: ALL_SHADER_BITS or the Bitwise OR of
UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER,
void UniformMatrix{2x3,3x2,2x4,4x2, uint program, enum shadertype,
TESS_{CONTROL, EVALUATION}_SHADER_BIT,
UNIFORM_BLOCK_REFERENCED_BY_{
3x4,4x3}{fd}v(int location, sizei count, uint index, sizei bufsize, sizei *length,
{VERTEX, GEOMETRY, FRAGMENT}_SHADER_BIT
FRAGMENT_SHADER, GEOMETRY_SHADER,
boolean transpose, const T *value); char *name);
TESS_CONTROL_SHADER, TESS_EVALUATION_SHADER}
(Shaders and Programs Continue >)

©2010 Khronos Group - Rev. 0610 www.opengl.org/registry


OpenGL 4.1 API Quick Reference Card - Page 3
Shaders and Programs (cont.) int GetFragDataLocation(uint program,
const char *name);
Program Queries [6.1.12] [6.1.18] void GetProgramiv(uint program,
enum pname, int *params);
void GetAttachedShaders(uint program, sizei
void UniformSubroutinesuiv(enum shadertype, int GetFragDataIndex(uint program, maxCount, sizei *count, uint *shaders); pname: DELETE _STATUS, LINK _STATUS,
sizei count, const uint *indices); const char *name); VALIDATE_STATUS, INFO_LOG_LENGTH,
void GetVertexAttrib{d f i}v(uint index, enum ATTACHED_SHADERS, ACTIVE_ATTRIBUTES,
Varying Variables [2.11.10] [2.14.10] pname, T *params); ACTIVE_ UNIFORMS,
void TransformFeedbackVaryings( Shader and Program Queries pname: VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, ACTIVE_ATTRIBUTES_MAX_LENGTH,
uint program, sizei count, Shader Queries [6.1.12] [6.1.18] VERTEX_ATTRIB_ARRAY_ENABLED, ACTIVE_UNIFORM_MAX_LENGTH,
const char **varyings, enum bufferMode); VERTEX_ATTRIB_ARRAY_ SIZE, TRANSFORM_FEEDBACK_BUFFER_MODE,
bufferMode: {INTERLEAVED, SEPARATE}_ATTRIBS boolean IsShader(uint shader);
VERTEX_ATTRIB_ARRAY_ STRIDE, TRANSFORM_FEEDBACK_ VARYINGS,
void GetTransformFeedbackVarying( void GetShaderiv(uint shader, enum pname, VERTEX_ATTRIB_ARRAY_ TYPE, ACTIVE_UNIFORM_BLOCKS,
uint program, uint index, sizei bufSize, int *params); VERTEX_ATTRIB_ARRAY_ NORMALIZED, TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH,
sizei *length, sizei *size, enum *type, pname: SHADER_TYPE, {GEOMETRY, VERTEX}_SHADER, VERTEX_ATTRIB_ARRAY_ DIVISOR, ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH,
char *name); TESS_{CONTROL, EVALUATION}_SHADER, GEOMETRY_VERTICES_OUT,
VERTEX_ATTRIB_ARRAY_ INTEGER, GEOMETRY_{INPUT, OUTPUT}_TYPE,
*type returns NONE, FLOAT{_VECn}, DOUBLE{_VECn}, FRAGMENT_SHADER, {DELETE, COMPILE}_STATUS,
CURRENT_VERTEX_ATTRIB GEOMETRY_SHADER_INVOCATIONS,
{UNSIGNED_}INT, {UNSIGNED_}INT_VECn, MATnxm, INFO_LOG_LENGTH, SHADER_SOURCE_LENGTH
{FLOAT, DOUBLE}_MATn, {FLOAT, DOUBLE}_MATnxm void GetVertexAttribl{i ui}v(uint index, TESS_CONTROL_OUTPUT_VERTICES,
void GetShaderInfoLog(uint shader, enum pname, T *params); TESS_GEN_MODE, TESS_GEN_SPACING,
Shader Execution [2.11.11] [2.14.11] sizei bufSize, sizei *length, char *infoLog); pname: see GetVertexAttrib{d f i}v TESS_GEN_VERTEX_ORDER,
void ValidateProgram(uint program); void GetShaderSource(uint shader, TESS_GEN_POINT_MODE,
void ValidateProgramPipeline( sizei bufSize, sizei *length, char *source); void GetVertexAttribLdv(uint index, PROGRAM_SEPARABLE,
uint pipeline); enum pname, double *params); PROGRAM_BINARY_{LENGTH, RETRIEVABLE_HINT}
void GetShaderPrecisionFormat( pname: see GetVertexAttrib{d f i}v
Tessellation Control Shaders [2.12.1] [2.15.1] enum shadertype, enum precisiontype, boolean IsProgramPipeline(uint pipeline);
void PatchParameterfv(enum pname, int *range, int *precision); void GetVertexAttribPointerv(uint index, void GetProgramPipelineiv(uint pipeline,
const float *values); shadertype: {VERTEX, FRAGMENT}_SHADER enum pname, void **pointer); enum pname, int *params);
pname: PATCH_DEFAULT_{INNER, OUTER}_LEVEL precisiontype: LOW_{FLOAT, INT}, pname: VERTEX_ATTRIB_ARRAY_POINTER
MEDIUM_{FLOAT, INT}, HIGH_{FLOAT, INT} void GetUniform{f d i ui}v(uint program, void GetProgramInfoLog(uint program,
Fragment Shaders [3.9.2] [3.12.2] sizei bufSize, sizei *length, char *infoLog);
void BindFragDataLocation(uint program, void GetProgramStageiv(uint program, enum int location, T *params);
uint colorNumber, const char *name); shadertype, enum pname, int *values); void GetUniformSubroutineuiv( void GetProgramPipelineInfoLog(
pname: ACTIVE_SUBROUTINES, enum shadertype, int location, uint pipeline, sizei bufSize,
void BindFragDataLocationIndexed( sizei *length, char *infoLog);
uint program, uint colorNumber, ACTIVE_SUBROUTINE_{UNIFORMS, MAX_LENGTH}, uint *params);
uint index, const char *name); ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS,
ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH boolean IsProgram(uint program);

Rasterization [3] Pixel Storage Modes [3.7.1]


void PixelStore{if}(enum pname, T param);
format: RED, GREEN, BLUE, ALPHA, RGB, RGBA,
BGR, BGRA, LUMINANCE{_ALPHA}
Convolution Query [6.1.9]
void GetConvolutionFilter(enum target,
Enable/Disable(target) pname: {UN}PACK_x (where x may be SWAP_BYTES, type: UNSIGNED_{BYTE, SHORT, INT}, BYTE, enum format, enum type, void *image);
target: RASTERIZER_DISCARD, MULTISAMPLE, LSB_FIRST, ROW_LENGTH, SKIP_{PIXELS, ROWS}, SHORT, INT, UNSIGNED_BYTE_3_3_2, target: CONVOLUTION_1D, CONVOLUTION_2D
SAMPLE_SHADING ALIGNMENT, IMAGE_HEIGHT, SKIP_IMAGES) UNSIGNED_BYTE_2_3_3_REV, format and type: see GetColorTable
UNSIGNED_SHORT_5_6_5{_REV},
Multisampling [3.3.1] Pixel Transfer Modes [3.7.3, 6.1.3] UNSIGNED_SHORT_4_4_4_4{_REV}, void GetSeparableFilter(enum target,
Use to antialias points, lines, polygons, void PixelTransfer{if}(enum param, T value); UNSIGNED_SHORT_5_5_5_1, enum format, enum type, void *row,
bitmaps, and images. param: MAP_{COLOR, STENCIL}, UNSIGNED_SHORT_1_5_5_5_REV, void *column, void *span);
void GetMultisamplefv(enum pname, INDEX_{SHIFT, OFFSET}, x_ {SCALE, BIAS}, UNSIGNED_INT_8_8_8_8{_REV}, target: SEPARABLE_2D
uint index, float *val); DEPTH_{SCALE, BIAS}, UNSIGNED_INT_10_10_10_2, format and type: see GetColorTable
pname: SAMPLE_POSITION POST_CONVOLUTION_x_{SCALE, BIAS}, UNSIGNED_INT_2_10_10_10_REV
POST_COLOR_MATRIX_x_{SCALE, BIAS}, (where void GetConvolutionParameter{if}v(
void MinSampleShading(clampf value); x is RED, GREEN, BLUE, or ALPHA) [Table 3.2] void GetColorTableParameter{if}v( enum target, enum pname, T params);
enum target, enum pname, T params); target: CONVOLUTION_{1D, 2D}, SEPARABLE_2D
Points [3.4] void PixelMap{ui us f}v(enum map, sizei size, target: see ColorTable pname: {MAX_}CONVOLUTION_{WIDTH, HEIGHT},
void PointSize(float size); const T values); pname: COLOR_TABLE_x (where x may be SCALE, CONVOLUTION_x (where x may be FILTER_BIAS,
map: PIXEL_MAP_x_TO_x (where x may be BIAS, FORMAT, COLOR_TABLE_WIDTH, RED_SIZE, BORDER_COLOR, BORDER_MODE, FILTER_SCALE,
void PointParameter{if}(enum pname, {I,S,R,G,B,A}), PIXEL_MAP_I_TO_{R,G,B,A}
T param); GREEN_SIZE, BLUE_SIZE, ALPHA_SIZE, FORMAT)
[Table 3.3] LUMINANCE_SIZE, INTENSITY_SIZE)
void PointParameter{if}v(enum pname, void GetPixelMap{ui us f}v(enum map, Histogram Table Specification [3.7.3]
const T params); Convolution Filter Specification [3.7.3] void Histogram(enum target, sizei width,
pname: POINT_SIZE_MIN, POINT_SIZE_MAX, T data);
map: see PixelMap{ui us f}v Enable/Disable( enum internalformat, boolean sink);
POINT_DISTANCE_ATTENUATION, POST_CONVOLUTION_COLOR_TABLE) target: HISTOGRAM, PROXY_HISTOGRAM
POINT_FADE_THRESHOLD_SIZE,
POINT_SPRITE_COORD_ORIGIN Color Table Specification [3.7.3] void ConvolutionFilter2D(enum target, internalformat: see ColorTable except 1, 2, 3, and 4
param, params: LOWER_LEFT, UPPER_LEFT, void ColorTable(enum target, enum internalformat, sizei width,
enum internalformat, sizei width, Histogram Query [6.1.10]
pointer to point fade threshold sizei height, enum format, enum type, void GetHistogram(enum target,
enum format, enum type, const void *data);
Enable/Disable (target) const void *data); boolean reset, enum format, enum type,
target: VERTEX_PROGRAM_POINT_SIZE, target: CONVOLUTION_2D void *values);
target: {PROXY_}COLOR_TABLE,
POINT_SMOOTH, POINT_SPRITE. internalformat: see ColorTable target: HISTOGRAM
{PROXY_}POST_CONVOLUTION_COLOR_TABLE,
{PROXY_}POST_COLOR_MATRIX_COLOR_TABLE format: RED, GREEN, BLUE, ALPHA, RG, RGB, RGBA, format and type: see GetColorTable
Line Segments [3.5] internalformat: The formats in [Table 3.16] or [Tables
BGRA, LUMINANCE, LUMINANCE_ALPHA
void ResetHistogram(enum target);
void LineWidth(float width); 3.17-3.19] except RED, RG, type: BYTE, SHORT, INT, FLOAT, HALF_FLOAT, target: HISTOGRAM
UNSIGNED_{BYTE, SHORT, INT}
Enable/Disable(LINE_SMOOTH) DEPTH_{COMPONENT, STENCIL} base and sized
void GetHistogramParameter{if}v(
internal formats in those tables, all sized internal void ConvolutionFilter1D(enum target,
Other Line Seg. Features [3.5.2] formats with non-fixed internal data types as enum target, enum pname, T params);
enum internalformat, sizei width, target: HISTOGRAM, PROXY_HISTOGRAM
void LineStipple(int factor, ushort pattern); discussed in [3.9], and RGB9_E5. enum format, enum type, const void *data);
format: RED, GREEN, BLUE, ALPHA, RG, RGB, RGBA, pname: HISTOGRAM_x (where x may be FORMAT,
Enable/Disable(LINE_STIPPLE) target: CONVOLUTION_1D WIDTH, {RED, GREEN, BLUE, ALPHA}_SIZE,
BGRA, LUMINANCE, LUMINANCE_ALPHA internalformat, format, type: see ConvolutionFilter2D
void GetIntegerv(LINE_STIPPLE_PATTERN); type: see DrawPixels LUMINANCE_SIZE, SINK)
void ConvolutionParameter{if}v( Minmax Table Specification [3.7.3]
Enable/Disable( enum target, enum pname,
Polygons [3.6] POST_COLOR_MATRIX_COLOR_TABLE) Enable/Disable(MINMAX)
Enable/Disable(target) const T params);
target: POLYGON_STIPPLE, POLYGON_SMOOTH, void ColorTableParameter{if}v(enum target, target: CONVOLUTION_2D void Minmax(enum target,
CULL_FACE enum pname, const T params); pname: CONVOLUTION_FILTER_{SCALE, BIAS} enum internalformat, boolean sink);
target: POST_COLOR_MATRIX_COLOR_TABLE, target: MINMAX
void FrontFace(enum dir); {POST_CONVOLUTION_}COLOR_TABLE void SeparableFilter2D(enum target, internalformat: see ColorTable, omitting the values
dir: CCW, CW pname: COLOR_TABLE_SCALE, COLOR_TABLE_BIAS enum internalformat, sizei width, 1, 2, 3, 4 and INTENSITY base and sized internal
void CullFace(enum mode); sizei height, enum format, enum type, formats
mode: FRONT, BACK, FRONT_AND_BACK Alt. Color Table Specification Commands const void *row, const void *column);
void CopyColorTable(enum target, target: SEPARABLE_2D Minmax Query [6.1.11]
enum internalformat, int x, int y, void GetMinmax(enum target,
Stippling [3.6.2] internalformat, format, type: see ConvolutionFilter2D
boolean reset, enum format, enum type,
void PolygonStipple(const ubyte *pattern); sizei width);
Alt. Convolution Filter Spec. Commands void *values);
void GetPolygonStipple(void *pattern); void ColorSubTable(enum target, sizei start, void CopyConvolutionFilter2D(enum target, target: MINMAX
sizei count, enum format, enum type, void enum internalformat, int x, int y, format and type: see GetColorTable
Polygon Rasterization & Depth Offset *data); sizei width, sizei height);
[3.6.3 - 3.6.4] [3.6.4 - 3.6.5] target: CONVOLUTION_2D void ResetMinmax(enum target);
void CopyColorSubTable(enum target, target: MINMAX
void PolygonMode(enum face, enum mode); sizei start, int x, int y, sizei count); internalformat: see ConvolutionFilter2D
face: FRONT, BACK, FRONT_AND_BACK target and pname: see ColorTableParameter{if}v void CopyConvolutionFilter1D(enum target, void GetMinmaxParameter{if}v(
mode: POINT, LINE, FILL enum internalformat, int x, int y, enum target, enum pname, T params);
Color Table Query [6.1.8] sizei width); target: MINMAX
void PolygonOffset(float factor, float units); void GetColorTable(enum target, pname: MINMAX_FORMAT, MINMAX_SINK
target: CONVOLUTION_1D
Enable/Disable(target) enum format, enum type, void *table); internalformat: see ConvolutionFilter2D
target: POLYGON_OFFSET_{POINT, LINE, FILL} target: see ColorTableParameter{if}v
(more parameters ) (Rasterization Continue >)

©2010 Khronos Group - Rev. 0610 www.opengl.org/registry


OpenGL 4.1 API Quick Reference Card - Page 4
Rasterization (continued) Texturing [3.8] [3.9] target: TEXTURE_3D, TEXTURE_2D_ARRAY,
TEXTURE_CUBE_MAP_ARRAY
target: TEXTURE_BUFFER
internalformat: R8{I,UI}, R16{F, I, UI}, R32{F, I, UI},
Rasterization of Pixel Rectangles [4.3.1] [3.7.5] void ActiveTexture(enum texture); format and type: see TexImage3D RG8{I, UI}, RG16{F, I, UI}, RG32{F, I, UI},
void DrawPixels(sizei width, sizei height, texture: TEXTUREi (where i is RGB32{F, I, UI}, RGBA8{I, UI}, RGBA16{F, I, UI},
enum format, enum type, [0, max(MAX_TEXTURE_COORDS, void TexSubImage2D(enum target, int level, RGBA32{F, I, UI}
const void *data); MAX_COMBINED_TEXTURE_IMAGE_UNITS)-1]) int xoffset, int yoffset, sizei width,
format: {COLOR|STENCIL}_INDEX, RED, GREEN, BLUE, sizei height, enum format, enum type, Texture Parameters [3.8.8] [3.9.8]
DEPTH_{COMPONENT, STENCIL}, ALPHA, RG, Texture Objects [3.8.1] [3.9.1] const void *data); void TexParameter{if}(enum target,
RGB, RGBA, BGR, BGRA, LUMINANCE{_ALPHA} void BindTexture(enum target, target: see CopyTexImage2D enum pname, T param);
(*_INTEGER formats from {Table 3.6} not supported) uint texture); format and type: see TexImage2D
type: BITMAP, BYTE, SHORT, INT, FLOAT, HALF_FLOAT, target: TEXTURE_{1, 2}D{_ARRAY}, void TexSubImage1D(enum target, int level, void TexParameter{if}v(enum target,
UNSIGNED_{BYTE, SHORT, INT}, or value from TEXTURE_{3D, RECTANGLE, BUFFER}, int xoffset, sizei width, enum format, enum pname, const T *params);
[Table 3.5] TEXTURE_CUBE_MAP{_ARRAY}, enum type, const void *data); void TexParameterI{i ui}v(enum target,
void ClampColor(enum target, enum clamp); TEXTURE_2D_MULTISAMPLE{_ARRAY} target: TEXTURE_1D enum pname, const T *params);
target: CLAMP_{READ,FRAGMENT, VERTEX}_COLOR format, type: see TexImage1D target: TEXTURE_{1D,2D,3D},
clamp: TRUE, FALSE, FIXED_ONLY void DeleteTextures(sizei n,
const uint *textures); void CopyTexSubImage3D(enum target, TEXTURE_{1D,2D}_ARRAY, TEXTURE_RECTANGLE,
void PixelZoom(float zx, float zy); int level, int xoffset, int yoffset, int TEXTURE_CUBE_MAP{_ARRAY}
void GenTextures(sizei n, uint *textures); zoffset, int x, int y, sizei width, sizei pname: TEXTURE_WRAP_{S, T, R}, TEXTURE_PRIORITY,
Pixel Transfer Operations [3.7.6] height); TEXTURE_{MIN, MAG}_FILTER, TEXTURE_LOD_BIAS,
void ConvolutionParameter{if}( boolean AreTexturesResident(sizei n,
enum target, enum pname, T param); uint *textures, boolean *residences); target: see TexSubImage3D TEXTURE_BORDER_COLOR, DEPTH_TEXTURE_MODE,
target: CONVOLUTION_{1D, 2D}, SEPARABLE_2D TEXTURE_{MIN, MAX}_LOD, GENERATE_MIPMAP,
void PrioritizeTextures(sizei n, void CopyTexSubImage2D(enum target, TEXTURE_SWIZZLE_{R, G, B, A, RGBA},
pname: CONVOLUTION_BORDER_MODE int level, int xoffset, int yoffset, int x,
param: REDUCE, {CONSTANT, REPLICATE_}BORDER uint *textures, const clampf *priorities); TEXTURE_{BASE, MAX}_LEVELS,
int y, sizei width, sizei height);
target: TEXTURE_2D, TEXTURE_1D_ARRAY, TEXTURE_COMPARE_{MODE, FUNC} [Table 3.16]
Bitmaps [3.8] Sampler Objects [3.8.2] [3.9.2] [Table 3.22]
void Bitmap(sizei w, sizei h, float xb0, float yb0, TEXTURE_RECTANGLE,
float xbi, float ybi, const ubyte *data); void GenSamplers(sizei count, TEXTURE_CUBE_MAP_{POSITIVE, NEGATIVE}_{X, Y, Z}
uint *samplers); Cube Map Texture Select [3.8.10][3.9.10]
void CopyTexSubImage1D(enum target, Enable/Disable(
void BindSampler(uint unit, uint sampler); int level, int xoffset, int x, int y, sizei width); TEXTURE_CUBE_MAP_SEAMLESS)
Whole Framebuffer void SamplerParameter{if}v(uint sampler, target: TEXTURE_1D
Texture Minification [3.8.11] [3.9.11]
Selecting a Buffer for Writing [4.2.1] enum pname, const T param); Compressed Texture Images [3.8.5] [3.9.5] void GenerateMipmap(enum target);
void DrawBuffer(enum buf); void SamplerParameterI{u ui}v(uint sampler, void CompressedTexImage3D(enum target,
buf: NONE, FRONT{_LEFT, _RIGHT}, LEFT, RIGHT, int level, enum internalformat, sizei width, target: TEXTURE_{1D, 2D, 3D}, TEXTURE_{1D, 2D}_ARRAY,
BACK{_LEFT, _RIGHT}, FRONT_AND_BACK, enum pname, const T *params); sizei height, sizei depth, int border, TEXTURE_CUBE_MAP{_ARRAY}
COLOR_ATTACHMENTi (i = [0, MAX_COLOR_ pname: TEXTURE_WRAP_{S, T, R}, sizei imageSize, const void *data);
ATTACHMENTS - 1 ]), AUXi (i =[0, AUX_BUFFERS - 1 ]) TEXTURE_{MIN, MAG}_{FILTER, LOD}, target: see TexImage3D
Texture Environments & Functions [3.9.16]
TEXTURE_BORDER_COLOR, TEXTURE_LOD_BIAS, internalformat: COMPRESSED_RED_RGTC1_RED, void TexEnv{if}(enum target,
void DrawBuffers(sizei n, const enum *bufs); enum pname, T param);
bufs: NONE, FRONT_{LEFT, RIGHT}, BACK_LEFT, TEXTURE_COMPARE_{MODE, FUNC} COMPRESSED_SIGNED_RED_RGTC1_RED,
BACK_RIGHT, COLOR_ATTACHMENTi (i = void DeleteSamplers(sizei count, COMPRESSED_RG_RGTC2_RG, void TexEnv{if}v(enum target,
[0, MAX_COLOR_ATTACHMENTS - 1 ]), AUXi (i = const uint *samplers); COMPRESSED_SIGNED_RG_RGTC2 enum pname, const T params);
[0, AUX_BUFFERS - 1 ]) void CompressedTexImage2D(enum target, target: TEXTURE_{FILTER_CONTROL, ENV},
Texture Image Spec. [3.8.3] [3.9.3] POINT_SPRITE
Fine Control of Buffer Updates [4.2.2] void TexImage3D(enum target, int level, int level, enum internalformat,
void IndexMask(uint mask); int internalformat, sizei width, sizei height, sizei width, sizei height, int border, pname: TEXTURE_LOD_BIAS, TEXTURE_ENV_MODE,
sizei imageSize, const void *data); TEXTURE_ENV_COLOR, COMBINE_{RGB, ALPHA},
void ColorMask(boolean r, boolean g, sizei depth, int border, enum format, target: see TexImage2D, omitting compressed
boolean b, boolean a); enum type, const void *data); {RGB, ALPHA}_SCALE, COORD_REPLACE,
rectangular texture formats SRCn_RGB, SRCn_ALPHA, OPERANDn_RGB,
void ColorMaski(uint buf, boolean r, target: {PROXY_}TEXTURE_{3D, 2D_ARRAY}, internalformat: see CompressedTexImage3D OPERANDn_ALPHA (where n is [0, 1, 2])
boolean g, boolean b, boolean a); {PROXY_}TEXTURE_CUBE_MAP_ARRAY
void CompressedTexImage1D(enum target,
void DepthMask(boolean mask); internalformat: ALPHA, DEPTH_COMPONENT,
DEPTH_STENCIL, LUMINANCE{_ALPHA}, RED,
int level, enum internalformat, Texture Application [3.9.20]
void StencilMask(uint mask); sizei width, int border, sizei imageSize, Enable/Disable(param)
INTENSITY, RG, RGB, RGBA; or a sized internal const void *data); param: TEXTURE_{1D, 2D, 3D}, TEXTURE_CUBE_MAP
void StencilMaskSeparate(enum face, format from [Tables 3.12-3.13] [Tables 3.17-3.19]; target: TEXTURE_1D, PROXY_TEXTURE_1D
uint mask); COMPRESSED_{SIGNED_}{RED_RGTC1,RG_RGTC2}, internalformat: values are implementation-dependent
face: FRONT, BACK, FRONT_AND_BACK or a generic comp. format in [Table 3.14] [Table 3.20]
Enumerated Queries [6.1.3]
void CompressedTexSubImage3D( void GetTexEnv{if}v(enum env, enum value,
Clearing the Buffers [4.2.3] format: COLOR_INDEX, DEPTH_{COMPONENT, STENCIL}, enum target, int level, int xoffset, T data);
void Clear(bitfield buf); RED, GREEN, BLUE, ALPHA, RG, RGB, RGBA, BGR, int yoffset, int zoffset, sizei width, env: POINT_SPRITE, TEXTURE_{ENV,FILTER_CONTROL}
buf: Bitwise OR of ACCUM_BUFFER_BIT, BGRA, LUMINANCE{_ALPHA}, {RED, GREEN, BLUE, sizei height, sizei depth, enum format,
{COLOR, DEPTH, STENCIL}_BUFFER_BIT, ALPHA}_INTEGER, {RG, RGB, RGBA, BGR}_INTEGER, sizei imageSize, const void *data); void GetTexGen{ifd}v(enum coord,
BGRA_INTEGER [Table 3.3] [Table 3.6] target: see TexSubImage3D enum value, T data);
void ClearColor(clampf r, clampf g, coord: S, T, R, Q
clampf b, clampf a); type: BITMAP, {UNSIGNED_}BYTE, {UNSIGNED_}SHORT, format: see internalformat for
void ClearIndex(float index); {UNSIGNED_}INT, {HALF_}FLOAT, or a value from CompressedTexImage3D void GetTexParameter{if}v(enum target,
[Table 3.2] [Table 3.5] void CompressedTexSubImage2D( enum value, T data);
void ClearDepth(clampd d);
void TexImage2D(enum target, int level, enum target, int level, int xoffset, void GetTexParameterI{i ui}v(enum target,
void ClearDepthf(clampf d); int yoffset, sizei width, sizei height, enum value, T data);
int internalformat, sizei width,
void ClearStencil(int s); sizei height, int border, enum format, enum format, sizei imageSize, target: TEXTURE_{1D, 2D, 3D,RECTANGLE},
void ClearAccum(float r, float g, float b, float a); enum type, const void *data); cont void *data); TEXTURE_{1D, 2D}_ARRAY,
target: see TexSubImage2D TEXTURE_CUBE_MAP{_ARRAY}
void ClearBuffer{if ui}v(enum buffer, target: {PROXY_}TEXTURE_{2D, RECTANGLE,CUBE_MAP}, format: see TexImage2D value: TEXTURE_{RESIDENT, PRIORITY},
int drawbuffer, const T *value) {PROXY_}TEXTURE_1D_ARRAY, DEPTH_TEXTURE_MODE, GENERATE_MIPMAP,
buffer: COLOR, DEPTH, STENCIL TEXTURE_CUBE_MAP_{POSITIVE, NEGATIVE}_{X, Y, Z}, void CompressedTexSubImage1D( TEXTURE_{BASE, MAX}_LEVEL,
void ClearBufferfi(enum buffer, internalformat, format, and type: see TexImage3D enum target, int level, int xoffset, TEXTURE_BORDER_COLOR, TEXTURE_LOD_BIAS,
int drawbuffer, float depth, int stencil); sizei width, enum format, sizei imageSize, TEXTURE_COMPARE_{MODE, FUNC},
buffer: DEPTH_STENCIL void TexImage1D(enum target, int level, const void *data); TEXTURE_{MIN, MAG}_FILTER,
drawbuffer: 0 int internalformat, sizei width, int border, target: see TexSubImage1D TEXTURE_MAX_{LEVEL, LOD}, TEXTURE_MIN_LOD,
enum format, enum type, format: see TexImage1D TEXTURE_SWIZZLE_{R, G, B, A, RGBA},
Accumulation Buffer [4.2.4] const void *data); TEXTURE_WRAP_{S, T, R} [Table 3.16] [Table 3.22]
void Accum(enum op, float value); target: TEXTURE_1D, PROXY_TEXTURE_1D Multisample Textures [3.8.6] [3.9.6] void GetTexLevelParameter{if}v(
op: ACCUM, LOAD, RETURN, MULT, ADD. void TexImage3DMultisample(enum target,
type, internalformat, and format: see TexImage3D enum target, int lod, enum value,
sizei samples, int internalformat, T data);
Alternate Texture Image Spec. [3.8.4] [3.9.4] sizei width, sizei height, sizei depth,
Color Sum, Fog, and Hints void CopyTexImage2D(enum target, boolean fixedsamplelocations);
target: {PROXY_}TEXTURE_{1D, 2D, 3D},
TEXTURE_BUFFER, PROXY_TEXTURE_CUBE_MAP,
Color Sum [3.10] int level, enum internalformat, int x, target: {PROXY_}TEXTURE_2D_MULTISAMPLE_ARRAY {PROXY_}TEXTURE_{1D, 2D}_ARRAY,
Enable/Disable(COLOR_SUM) int y, sizei width, sizei height, int border); internalformat: ALPHA, RED, RG, RGB, RGBA, {PROXY_}TEXTURE_CUBE_MAP_ARRAY,
target: TEXTURE_{2D, RECTANGLE, 1D_ARRAY}, DEPTH_{COMPONENT, STENCIL}, STENCIL_INDEX, {PROXY_}TEXTURE_RECTANGLE,
Fog [3.11] TEXTURE_CUBE_MAP_{POSITIVE, NEGATIVE}_{X, Y, Z},
Enable/Disable(FOG) TEXTURE_CUBE_MAP_{POSITIVE, NEGATIVE}_{X, Y, Z} or sized internal formats corresponding to these
internalformat: see TexImage2D, except 1, 2, 3, 4 base formats TEXTURE_2D_MULTISAMPLE{_ARRAY},
void Fog{if}(enum pname, T param); PROXY_TEXTURE_2D_MULTISAMPLE,
void Fog{if}v(enum pname, T params); void CopyTexImage1D(enum target, void TexImage2DMultisample(enum target, PROXY_TEXTURE_2D_MULTISAMPLE{_ARRAY}
pname: FOG_MODE, FOG_COORD_SRC, FOG_DENSITY, int level, enum internalformat, int x, sizei samples, int internalformat, value: TEXTURE_{WIDTH, HEIGHT, DEPTH},
FOG_START, FOG_END, FOG_COLOR, FOG_INDEX int y, sizei width, int border); sizei width, sizei height, TEXTURE_{BORDER, COMPONENTS, SAMPLES},
target: TEXTURE_1D boolean fixedsamplelocations); TEXTURE_FIXED_SAMPLE_LOCATIONS,
Hints [5.4] [5.8] internalformat: see TexImage1D, except 1, 2, 3, 4 target: {PROXY_}TEXTURE_2D_MULTISAMPLE TEXTURE_{INTERNAL_FORMAT, SHARED_SIZE},
void Hint(enum target, enum hint); TEXTURE_COMPRESSED{_IMAGE_SIZE},
target: FRAGMENT_SHADER_DERIVATIVE_HINT, internalformat: see TexImage3DMultisample
void TexSubImage3D(enum target, int level, TEXTURE_BUFFER_DATA_STORE_BINDING,
TEXTURE_COMPRESSION_HINT, TEXTURE_x_{SIZE, TYPE} (where x can be RED,
PERSPECTIVE_CORRECTION_HINT, int xoffset, int yoffset, int zoffset, Buffer Textures [3.8.7] [3.9.7]
sizei width, sizei height, sizei depth, GREEN, BLUE, ALPHA, LUMINANCE, INTENSITY,
{LINE, POLYGON,POINT}_SMOOTH_HINT, void TexBuffer(enum target, DEPTH, STENCIL)
FOG_HINT, GENERATE_MIPMAP_HINT enum format, enum type, const void *data); enum internalformat, uint buffer);
hint: FASTEST, NICEST, DONT_CARE (Texturing Continue >)
(see parameters ) (see parameters )

©2010 Khronos Group - Rev. 0610 www.opengl.org/registry


OpenGL 4.1 API Quick Reference Card - Page 5
Texturing (continued) Per-Fragment Operations func: NEVER, ALWAYS, LESS, LEQUAL, EQUAL,
GREATER, GEQUAL, NOTEQUAL
void BlendFunc(enum src, enum dst);
srd, dst: see BlendFuncSeparate
Texture Queries [6.1.4] Scissor Test [4.1.2] void StencilOp(enum sfail, enum dpfail,
void GetTexImage(enum tex, int lod, Enable/Disable(SCISSOR_TEST) void BlendFunci(uint buf, enum src, enum dst);
enum dppass); srd, dst: see BlendFuncSeparate
enum format, enum type, void *img); Enablei/Disablei(SCISSOR_TEST, uint index) void StencilOpSeparate(enum face,
tex: TEXTURE_{1, 2}D{_ARRAY}, void ScissorArrayv(uint first, sizei count, enum sfail, enum dpfail, enum dppass); void BlendFuncSeparate(enum srcRGB,
TEXTURE_3D, TEXTURE_RECTANGLE, const int *v); face: FRONT, BACK, FRONT_AND_BACK enum dstRGB, enum srcAlpha,
TEXTURE_CUBE_MAP_ARRAY, enum dstAlpha);
TEXTURE_CUBE_MAP_POSITIVE_{X, Y, Z},
void ScissorIndexed(uint index, int left, sfail, dpfail, and dppass: KEEP, ZERO, REPLACE, INCR, src, dst, srcRGB, dstRGB, srcAlpha, dstAlpha: ZERO,
TEXTURE_CUBE_MAP_NEGATIVE_{X, Y, Z}
int bottom, sizei width, sizei height); DECR, INVERT, INCR_WRAP, DECR_WRAP
ONE, SRC_{COLOR, ALPHA}, DST_{COLOR, ALPHA},
format: see TexImage3D void ScissorIndexedv(uint index, int *v); Depth Buffer Test [4.1.5] [4.1.6] SRC_ALPHA_SATURATE, CONSTANT_{COLOR, ALPHA},
type: BITMAP, {UNSIGNED_}BYTE, void Scissor(int left, int bottom, sizei width, Enable/Disable(DEPTH_TEST) ONE_MINUS_SRC_{COLOR, ALPHA},
UNSIGNED_{SHORT}, {UNSIGNED_}INT, sizei height); void DepthFunc(enum func); ONE_MINUS_DST_{COLOR, ALPHA},
{HALF_}FLOAT, or value from [Table 3.2] [Table 3.5] func: see StencilOpSeparate ONE_MINUS_CONSTANT_{COLOR, ALPHA},
Multisample Fragment Operations [4.1.3] {ONE_MINUS_}SRC1_ALPHA
void GetCompressedTexImage( Enable/Disable(target) Occlusion Queries [4.1.6] [4.1.7]
enum target, int lod, void *img); target: SAMPLE_ALPHA_TO_{COVERAGE, ONE}, void BlendFuncSeparatei(uint buf,
BeginQuery(enum target, uint id); enum srcRGB, enum dstRGB,
target: see “tex” for GetTexImage SAMPLE_{COVERAGE, MASK}, MULTISAMPLE
void SampleCoverage(clampf value, EndQuery(enum target); enum srcAlpha, enum dstAlpha);
boolean IsTexture(uint texture); target: SAMPLES_PASSED, ANY_SAMPLES_PASSED dst, dstRGB, dstAlpha, src, srcRGB, srcAlpha:
boolean invert); see BlendFuncSeparate
Sampler Queries [6.1.5] void SampleMaski(uint maskNumber, Blending [4.1.7] [4.1.8]
boolean IsSampler(uint sampler); bitfield mask); Enable/Disable(BLEND) void BlendColor(clampf red, clampf green,
void GetSamplerParameter{if}v( Enablei/Disablei(BLEND, uint index) clampf blue, clampf alpha);
Alpha Test [4.1.4]
uint sampler, enum pname, Enable/Disable(ALPHA_TEST) void BlendEquation(enum mode); Dithering [4.1.9] [4.1.10]
T *params); void AlphaFunc(enum func, clampf ref); Enable/Disable(DITHER)
void BlendEquationi(uint buf, enum mode);
void GetSamplerParameterI{i ui}v( func: NEVER, ALWAYS, LESS,LEQUAL, EQUAL, GEQUAL,
GREATER, NOTEQUAL void BlendEquationSeparate(enum modeRGB, Logical Operation [4.1.10] [4.1.11]
uint sampler, enum pname, enum modeAlpha); Enable/Disable(enum op)
T *params); Stencil Test [4.1.4] [4.1.5] mode, modeRGB, and modeAlpha: FUNC_ADD, op: INDEX_LOGIC_OP, LOGIC_OP, COLOR_LOGIC_OP
pname: TEXTURE_WRAP_{S, T, R}, Enable/Disable(STENCIL_TEST) FUNC_{SUBTRACT, REVERSE}_SUBTRACT, MIN, MAX
TEXTURE_{MIN, MAG}_FILTER, void LogicOp(enum op);
TEXTURE_BORDER_COLOR, TEXTURE_LOD_BIAS,
void StencilFunc(enum func, int ref, uint mask); void BlendEquationSeparatei(uint buf, enum op: CLEAR, AND, AND_REVERSE, COPY,
void StencilFuncSeparate(enum face, modeRGB, enum modeAlpha); AND_INVERTED, NOOP, OR, OR, NOR, EQUIV,
TEXTURE_{MIN, MAX}_LOD, mode, modeRGB, and modeAlpha:
enum func, int ref, uint mask); INVERT, OR_REVERSE, COPY_INVERTED,
TEXTURE_COMPARE_{MODE, FUNC} see BlendEquationSeparate OR_INVERTED, NAND, SET
(parameters )
target: RENDERBUFFER
Framebuffer Objects internalformat: see TexImage2DMultisample
void FramebufferTexture3D(enum target,
enum attachment, enum textarget,
Framebuffer Completeness [4.4.4]
enum CheckFramebufferStatus(enum target);
Binding and Managing [4.4.1] void RenderbufferStorage(enum target, uint texture, int level, int layer); target: {DRAW, READ}FRAMEBUFFER, FRAMEBUFFER
void BindFramebuffer(enum target, enum internalformat, sizei width, textarget: TEXTURE_3D returns: FRAMEBUFFER_COMPLETE or a constant
uint framebuffer); sizei height); target and attachment: see framebufferRenderbuffer indicating the violating value
target: {DRAW, READ_}FRAMEBUFFER target and internalformat: see
void DeleteFramebuffers(sizei n, RenderbufferStorageMultisample void FramebufferTexture2D(enum target,
enum attachment, enum textarget, Framebuffer Object Queries [6.1.13] [6.1.19]
const uint *framebuffers); boolean IsFramebuffer(uint framebuffer);
Attaching Renderbuffer Images uint texture, int level);
void GenFramebuffers(sizei n, uint *ids); textarget: TEXTURE_{RECTANGLE, 3D},
void FramebufferRenderbuffer(enum target, void GetFramebufferAttachmentParameteriv(
enum attachment, enum TEXTURE_2D_MULTISAMPLE{_ARRAY}, enum target, enum attachment,
Attaching Images [4.4.2] TEXTURE_CUBE_MAP_POSITIVE_{X, Y, Z},
renderbuffertarget, enum pname, int *params);
Renderbuffer Objects uint renderbuffer);
TEXTURE_CUBE_MAP_NEGATIVE_{X, Y, Z}
target, attachment: see FramebufferRenderbuffer target: {DRAW, READ}_FRAMEBUFFER, FRAMEBUFFER
void BindRenderbuffer(enum target, target: {DRAW, READ_}FRAMEBUFFER
uint renderbuffer); attachment: FRONT_{LEFT, RIGHT}, BACK_{LEFT,RIGHT},
target: RENDERBUFFER
attachment: {DEPTH, STENCIL}_ATTACHMENT, void FramebufferTexture1D(enum target, COLOR_ATTACHMENTi, AUXi, DEPTH, STENCIL,
DEPTH_STENCIL_ATTACHMENT, enum attachment, enum textarget, {DEPTH, STENCIL}_ATTACHMENT,
void DeleteRenderbuffers(sizei n, COLOR_ATTACHMENTi (where i is uint texture, int level); DEPTH_STENCIL_ATTACHMENT
const uint *renderbuffers); [0, MAX_COLOR_ATTACHMENTS - 1]) textarget: TEXTURE_1D pname: FRAMEBUFFER_ATTACHMENT_x (where x
renderbuffertarget: RENDERBUFFER target, attachment: see FramebufferRenderbuffer may be OBJECT_TYPE, OBJECT_NAME, RED_SIZE,
void GenRenderbuffers(sizei n, GREEN_SIZE, BLUE_SIZE, ALPHA_SIZE, DEPTH_SIZE,
uint *renderbuffers); Attaching Texture Images void FramebufferTextureLayer(enum target, STENCIL_SIZE, COMPONENT_TYPE,
void RenderbufferStorageMultisample( void FramebufferTexture(enum target, enum attachment, uint texture, COLOR_ENCODING, TEXTURE_LEVEL, LAYERED,
enum target, sizei samples, enum attachment, uint texture, int level); int level, int layer); TEXTURE_CUBE_MAP_FACE, TEXTURE_LAYER)
enum internalformat, sizei width, target: {DRAW, READ_}FRAMEBUFFER target, attachment: see FramebufferTexture3D
sizei height); attachment: see FramebufferRenderbuffer Renderbuffer Object Queries [6.1.14] [6.1.20]
(parameters )
boolean IsRenderbuffer(uint renderbuffer);
void GetRenderbufferParameteriv(
Special Functions Enumerated Query [6.1.3] Timer Queries [5.1] [5.4]
enum target, enum pname, int *params);
void GetMap{ifd}v(enum map, Timer queries use query objects to track the
Evaluators [5.1] enum value, T data); amount of time needed to fully complete a set target: RENDERBUFFER
Evaluators provide a means to use a map: see target for Map1 of GL commands, or to determine the current pname: RENDERBUFFER_x (where x may be WIDTH,
polynomial or rational polynomial mapping value: ORDER, COEFF, DOMAIN time of the GL. HEIGHT, INTERNAL_FORMAT, SAMPLES,
to produce vertex, normal, and texture {RED, GREEN, BLUE, ALPHA, DEPTH, STENCIL}_SIZE)
coordinates, and colors. Transformations, Selection [5.2] void QueryCounter(uint id, TIMESTAMP);
lighting, primitive assembly, rasterization, and Determine which primitives are drawn into a void GetInteger64v(TIMESTAMP,
per-pixel operations are not affected. region of a window. The region is defined by the int64 *data);
void Map1{fd}(enum target, T u1, T u2, current model-view and perspective matrices. Synchronization
int stride, int order, T points); Display Lists [5.5] Flush and Finish [5.2] [5.6]
void InitNames(void); void Flush(void);
target: MAP1_VERTEX_{3,4}, MAP1_{INDEX, NORMAL}, A display list is a group of GL commands
MAP1_COLOR_4, MAP1_TEXTURE_COORD_{1,2,3,4} void PopName(void); and arguments that has been stored for void Finish(void);
void Map2{fd}(enum target, T u1, T u2, subsequent execution. The GL may be
void PushName(uint name); instructed to process a particular display list
int ustride, int uorder, T v1, T v2, Sync Objects and Fences [5.3] [5.7]
int vstride, int vorder, const T points); void LoadName(uint name); (possibly repeatedly) by providing a number sync FenceSync(enum condition, bitfield flags);
target: see Map1, except replace MAP1 with MAP2 that uniquely specifies it. condition: SYNC_GPU_COMMANDS_COMPLETE
int RenderMode(enum mode); flags: must be 0
void EvalCoord{12}{fd}(T arg); mode: RENDER, SELECT, FEEDBACK void NewList(uint n, enum mode);
mode: COMPILE, COMPILE_AND_EXECUTE void DeleteSync(sync sync);
void EvalCoord{12}{fd}v(const T arg); void SelectBuffer(sizei n, uint *buffer); void EndList(void);
void MapGrid1{fd}(int n, T u1, T u2); void CallList(uint n); Waiting for Sync Objects [5.3.1] [5.7.1]
Feedback [5.3] enum ClientWaitSync(sync sync, bitfield flags,
void MapGrid2{fd}(int nu, T u1, T u2, When in feedback mode, framebuffer updates void CallLists(sizei n, enum type, uint64 timeout_ns);
int nv, T v1, T v2); are not performed. Instead, information about const void *lists); flags: SYNC_FLUSH_COMMANDS_BIT, or zero
primitives that would have otherwise been type: BYTE, UNSIGNED_BYTE, SHORT, {2,3,4}_BYTES,
void EvalMesh1(enum mode, int p1, int p2); rasterized is returned to the application via the UNSIGNED_SHORT, INT, UNSIGNED_INT, FLOAT void WaitSync(sync sync, bitfield flags,
mode: POINT, LINE feedback buffer.
uint64 timeout_ns);
void ListBase(uint base); timeout_ns: TIMEOUT_IGNORED
void EvalMesh2(enum mode, int p1, int p2, void FeedbackBuffer(sizei n, enum type,
int q1, int q2); float *buffer); uint GenLists(sizei s); Sync Object Queries [6.1.8] [6.1.14]
mode: FILL, POINT, LINE type: 2D, 3D, 3D_COLOR, 3D_COLOR_TEXTURE, boolean IsList(uint list); void GetSynciv(sync sync, enum pname,
void EvalPoint1(int p);
4D_COLOR_TEXTURE sizei bufSize, sizei *length, int *values);
void DeleteLists(uint list, sizei range); pname: OBJECT_TYPE, SYNC_{STATUS,CONDITION, FLAGS}
void PassThrough(float token);
void EvalPoint2(int p, int q); boolean IsSync(sync sync);

©2010 Khronos Group - Rev. 0610 www.opengl.org/registry


OpenGL Shading Language 4.10 Quick Reference Card - Page 6
State and State Requests void GetDoublev(enum pname, double *data); Pointer & String Queries [6.1.6] [6.1.12]
void GetPointerv(enum pname,
ubyte *GetStringi(enum name, uint index);
name: EXTENSIONS
A complete list of symbolic constants for states void GetBooleani_v(enum target, uint index, index: range is [0, NUM_EXTENSIONS - 1]
is shown in the tables in [6.2]. boolean *data); void **params);
void GetIntegeri_v(enum target, uint index, pname: {SELECTION, FEEDBACK}_BUFFER_POINTER, Saving and Restoring State [6.1.21]
Simple Queries [6.1.1] int *data); {VERTEX, NORMAL, COLOR}_ARRAY_POINTER, void PushAttrib(bitfield mask);
void GetBooleanv(enum pname, {SECONDARY_COLOR, INDEX}_ARRAY_POINTER, mask: ALL_ATTRIB_BITS, or the bitwise OR of the
boolean *data); void GetFloati_v(enum target, uint index, {TEXTURE, FOG}_COORD_ARRAY_POINTER, attribute groups in [Table 6.3].
float *data); EDGE_FLAG_ARRAY_POINTER void PushClientAttrib(bitfield mask);
void GetIntegerv(enum pname, int *data); mask: CLIENT_ALL_ATTRIB_BITS, or the bitwise OR of
void GetInteger64i_v(enum target, ubyte *GetString(enum name);
void GetInteger64v(enum pname, uint index, int64 *data); the attribute groups in [Table 6.3].
int64 *data); name: RENDERER, VENDOR, VERSION,
boolean IsEnabled(enum cap); SHADING_LANGUAGE_VERSION, EXTENSIONS void PopAttrib(void);
void GetFloatv(enum pname, float *data); void PopClientAttrib(void);
boolean IsEnabledi(enum target, uint index);

Reading, and Copying Pixels type: {HALF_}FLOAT, {UNSIGNED_}BYTE, {UNSIGNED_}SHORT, BITMAP, Copying Pixels [4.3.2] [4.3.3]
{UNSIGNED_}INT, FLOAT_32_UNSIGNED_INT_24_8_REV, and
Reading Pixels [4.3.1] [4.3.2] void CopyPixels(int x, int y, sizei width, sizei height, enum type);
UNSIGNED_{BYTE, SHORT, INT}_* values from [Table 3.2] [Table 3.5] type: COLOR, STENCIL, DEPTH, DEPTH_STENCIL
void ReadPixels(int x, int y, sizei width, sizei height,
enum format, enum type, void *data); void ReadBuffer(enum src); void BlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1,
format: {COLOR, STENCIL}_INDEX, DEPTH_{COMPONENT, STENCIL}, src: NONE, FRONT{_LEFT, RIGHT}, LEFT, RIGHT, BACK{_LEFT, RIGHT}, int dstX0, int dstY0, int dstX1, int dstY1, bitfield mask,
RED, GREEN, BLUE, RG, RGB, RGBA, LUMINANCE{_ALPHA}, BGR, FRONT_AND_BACK, AUXi (i = [0, AUX_BUFFERS - 1 ]), enum filter);
{RED, GREEN, BLUE, ALPHA, RG, RGB, RGBA, BGR, BGRA}_INTEGER, COLOR_ATTACHMENTi (i = [0, MAX_COLOR_ATTACHMENTS - 1]) mask: Bitwise OR of {COLOR, DEPTH, STENCIL}_BUFFER_BIT
BGRA, ALPHA [Table 3.3] [Table 3.6] filter: LINEAR, NEAREST
(more parameters ) Also see DrawPixels, ClampColor, and PixelZoom in the Rasterization section of this reference card.

The OpenGL® Shading Language is used to create shaders for each of the Preprocessor [3.3]
programmable processors contained in the OpenGL processing pipeline. Preprocessor Operators
[n.n.n] and [Table n.n] refer to sections and tables in the OpenGL Shading Preprocessor operators follow C++ standards. Expressions are evaluated according to the behavior
Language 4.10 specification at www.opengl.org/registry of the host processor, not the processor targeted by the shader.

Content shown in blue is removed from the OpenGL 4.1 core profile and #version 410 “#version 410” is required in shaders using version 4.10 of the language.
present only in the OpenGL 4.1 compatibility profile. Use profile to indicate core or compatibilty. If no profile specified, the
#version 410 profile default is core.

#extension
Types [4.1] Integer Sampler Types (Opaque) extension_name : behavior • behavior: require, enable, warn, disable
• extension_name: the extension supported by the compiler, or “all”
Transparent Types isampler[1,2,3]D integer 1D, 2D, or 3D texture #extension all : behavior
void no function return value isamplerCube integer cube mapped texture
bool Boolean isampler2DRect int. 2D rectangular texture Preprocessor Directives
int, uint signed/unsigned integers isampler[1,2]DArray integer 1D, 2D array texture Each number sign (#) can be preceded in its line only by spaces or horizontal tabs.
float single-precision floating- isamplerBuffer integer buffer texture # #define #elif #else #endif #error
point scalar #extension #if #ifdef #ifndef #include #line
isampler2DMS int. 2D multi-sample texture #pragma #undef #version
double double-precision floating isampler2DMSArray int. 2D multi-sample array tex.
scalar
isamplerCubeArray int. cube map array texture Predefined Macros
vec2, vec3, vec4 floating point vector
dvec2, dvec3, dvec4 double precision floating- Unsigned Integer Sampler Types (Opaque) __LINE__ __FILE__ Decimal integer constants. FILE says which source string number is being
point vectors processed, or the path of the string if the string was an included string
usampler[1,2,3]D uint 1D, 2D, or 3D texture
bvec2, bvec3, bvec4 Boolean vectors usamplerCube uint cube mapped texture GL_compatibility_profile Integer 1 if the implementation supports the compatibility profile
ivec2, ivec3, ivec4 signed and unsigned integer usampler2DRect uint rectangular texture
uvec2, uvec3, uvec4 vectors __VERSION__ Decimal integer, e.g.: 410
mat2, mat3, mat4 2x2, 3x3, 4x4 float matrix usampler[1,2]DArray 1D or 2D array texture
mat2x2, mat2x3, 2-column float matrix of usamplerBuffer uint buffer texture
mat2x4 2, 3, or 4 rows usampler2DMS uint 2D multi-sample texture Qualifiers Uniform Qualifiers [4.3.5]
Declare global variables with same values
mat3x2, mat3x3, 3-column float matrix of usampler2DMSArray uint 2D multi-sample array tex. Storage Qualifiers [4.3] across entire primitive processed. Examples:
mat3x4 2, 3, or 4 rows Declarations may have one storage qualifier.
usamplerCubeArray uint cube map array texture uniform vec4 lightPosition;
mat4x2, mat4x3, 4-column float matrix of
mat4x4 2, 3, or 4 rows Implicit Conversions (All others must use constructors) (default) local read/write memory, uniform vec3 color = vec3(0.7, 0.7, 0.2);
none
or input parameter
dmat2, dmat3, dmat4 2x2, 3x3, 4x4 double- int -> uint Layout Qualifiers [4.3.8]
precision float matrix int, uint -> float compile-time constant, or read-only layout(layout-qualifiers) block-declaration
const
dmat2x2, dmat2x3, 2-col. double-precision float int, uint, float -> double function parameter layout(layout-qualifiers) in/out/uniform
dmat2x4 matrix of 2, 3, 4 rows
ivec2|3|4 -> uvec2|3|4 linkage into shader from previous layout(layout-qualifiers) in/out/uniform
dmat3x2, dmat3x3, 3-col. double-precision float in
ivec2|3|4 -> vec2|3|4 stage declaration
dmat3x4 matrix of 2, 3, 4 rows
uvec2|3|4 -> vec2|3|4 linkage w/centroid based Input Layout Qualifiers
dmat4x2, dmat4x3, 4-column double-precision centroid in
dmat4x4 float matrix of 2, 3, 4 rows vec2|3|4 -> dvec2|3|4 interpolation For all shader stages:
ivec2|3|4 -> dvec2|3|4 location = integer-constant
Floating-Point Sampler Types (Opaque) input linkage w/per-sample
uvec2|3|4 -> dvec2|3|4 sample in For tessellation evaluation shaders:
interpolation
sampler[1,2,3]D 1D, 2D, or 3D texture mat2|3|4 -> dmat2|3|4 triangles, quads, equal_spacing, isolines,
mat2x3|2x4 -> dmat2x3|2x4 out linkage out of a shader to next stage fractional_{even,odd}_spacing, cw, ccw,
samplerCube cube mapped texture point_mode
sampler2DRect rectangular texture mat3x2|3x4 -> dmat3x2|3x4 linkage w/centroid based
centroid out For geometry shader inputs:
mat4x2|4x3 -> dmat4x2|4x3 interpolation
sampler[1,2]DShadow 1D,2D depth texture/ points, lines, {lines,triangles}_adjacency,
compare Aggregation of Basic Types output linkage w/per-sample triangles, invocations = integer-constant
sample out
Arrays float[3] foo; float foo[3]; interpolation For fragment shaders only for
sampler2DRectShadow rectangular texture/
comparison • structures and blocks can be arrays linkage between a vertex shader and redeclaring built-in variable gl_FragCoord:
• supports only 1-dimensional arrays attribute ‡ origin_upper_left, pixel_center_integer
sampler[1,2]DArray 1D or 2D array texture OpenGL for per-vertex data
• structure members can be arrays
sampler[1,2]DArrayShadow 1D or 2D array depth Structures struct type-name { linkage between a shader, OpenGL, Output Layout Qualifiers
texture/comparison members uniform For all shader stages:
and the application
} struct-name[]; location = integer-constant
samplerBuffer buffer texture // optional variable declaration, linkage between a vertex shader and
varying ‡ For tessellation control shaders:
sampler2DMS 2D multi-sample texture optionally an array a fragment shader for interpolated vertices = integer-constant
centroid varying ‡
Blocks in/out/uniform block-name { data
sampler2DMSArray 2D multi-sample array For geometry shader outputs:
texture // interface matching by block name points, line_strip, triangle_strip,
patch in tessellation eval. shader input
optionally-qualified members max_vertices = integer-constant,
samplerCubeArray cube map array texture } instance-name[]; patch out tessellation control shader output stream = integer-constant
samplerCubeArrayShadow cube map array depth // optional instance name, optionally
texture with comparison an array ‡ Qualifier is deprecated but not removed from core specification. (Qualifiers Continue >)

©2010 Khronos Group - Rev. 0610 www.opengl.org/registry


OpenGL Shading Language 4.10 Quick Reference Card - Page 7
Qualifiers (continued) Parameter Qualifiers [4.4]
Input values copied in at function call time,
Precise Qualifier [4.7]
Ensures that operations are executed in stated
Order of Qualification [4.8]
When multiple qualifications are present, they
For fragment shaders: output values copied out at function return. order with operator consistency. Requires two must follow this strict order:
index = integer-constant none (default) same as in identical multiplies, followed by an add. precise invariant interpolation storage precision
in for function parameters passed into precise out vec4 Position = a * b + c * d; storage parameter precision
Uniform-Block Layout Qualifiers
Layout qualifier identifiers for uniform blocks: function
shared, packed, std140, {row, column}_major out for function parameters passed back
out of function, but not initialized when Operations and Constructors Statements and Structure
Interpolation Qualifier [4.3.9] passed in Iteration and Jumps [6.3-4]
inout for function parameters passed both into
Vector & Matrix Constructors [5.4.2]
Qualify outputs from vertex shader and inputs mat2(vec2, vec2); // 1 col./arg.
and out of a function Function call by value-return
to fragment shader. mat2x3(vec2, float, vec2, float); // col. 2
smooth perspective correct interpolation dmat2(dvec2, dvec2); // 1 col./arg. Iteration for (;;) { break, continue }
Precision Qualifiers [4.5] while ( ) { break, continue }
Precision qualifiers have no effect on precision; dmat3(dvec3, dvec3, dvec3); // 1 col./arg.
do { break, continue } while ( );
flat no interpolation they aid code portability with OpenGL ES:
highp, mediump, lowp Structure Constructor Example [5.4.3] Selection if ( ) { }
noperspective linear interpolation struct light {members; }; if ( ) { } else { }
Invariant Qualifiers Examples [4.6] light lightVar = light(3.0, vec3(1.0, 2.0, 3.0)); switch ( ) { case integer: … break; …
default: … }
The following predeclared variables can be #pragma STDGL force all output variables Array Constructor Example [5.4.4]
redeclared with an interpolation qualifier: invariant(all) to be invariant Entry void main()
const float c[3] = float[3](5.0, b + 1.0, 1.1);
Vertex language: Fragment language: invariant gl_Position; qualify a previously Jump break, continue, return
gl_FrontColor gl_Color declared variable Matrix Component Examples [5.6] (There is no ‘goto’)
gl_BackColor gl_SecondaryColor Examples of access components of a matrix with
gl_FrontSecondaryColor invariant centroid out qualify as part of a array subscripting syntax: Exit return in main()
gl_BackSecondaryColor vec3 Color; variable declaration mat4 m; // m is a matrix discard // Fragment shader only
m[1] = vec4(2.0); // sets 2nd col. to all 2.0
m[0][0] = 1.0; // sets upper left element to 1.0 Subroutines [6.1.2]
Operators & Expressions [5.1] 11. | bit-wise inclusive or m[2][3] = 2.0; // sets 4th element of 3rd col. to 2.0 Declare types with the subroutine keyword:
Numbered in order of precedence. Relational subroutine returnType
and equality operators > < <= >= == != evalu- 12. && logical and Examples of operations on matrices and vectors: subroutineTypeName(type0 arg0,
ate to Boolean. Compare vectors component- m = f * m; // scalar * matrix component-wise type1 arg1, ..., typen argn);
wise with functions such as lessThan(), 13. ^^ logical exclusive or v = f * v; // scalar * vector component-wise
equal(), etc. 14. || logical inclusive or v = v * v; // vector * vector component-wise
m = m +/- m; // matrix +/- matrix comp.-wise Associate functions with subroutine types
1. () parenthetical grouping selects an entire operand. Use of matching declarations by defining the
m = m * m; // linear algebraic multiply
array subscript 15. ?: mix() to select indiv. components functions with the subroutine keyword
[] of vectors. f = dot(v, v); // vector dot product
function call & constructor and a list of subroutine types the function
() v = cross(v, v); // vector cross product matches:
2. structure = += -=
. *= /= assignment subroutine(subroutineTypeName0, ...,
field or method selector, swizzler 16. Structure & Array Operations [5.7]
++ -- %= <<= >>= arithmetic assignments subroutineTypeNameN)
postfix increment and decrement Select structure fields, length() method of an
&= ^= |= returnType functionName(type0 arg0,
++ -- prefix increment and decrement array using the period (.) operator. Other operators: type1 arg1, ..., typen argn){ ... }
3.
+-~! unary 17. , sequence . field or method selector // function body
4. */% multiplicative Vector Components [5.5] In addition to == != equality Declare subroutine type variables with a
5. +- additive array numeric subscript syntax, names of vec- specific subroutine type in a subroutine
tor components denoted by a single letter. = assignment uniform variable declaration:
6. << >> bit-wise shift Components can be swizzled and replicated.
subroutine uniform subroutineTypeName
7. < > <= >= relational {x, y, z, w} Vectors representing points or normals [] indexing (arrays only) subroutineVarName;
8. == != equality {r, g, b, a} Vectors representing colors Array elements are accessed using the array
subscript operator ( [ ] ), e.g.: Subroutine type variables are assigned to
9. & bit-wise and functions through the UniformSubroutinesuiv
{s, t, p, q} Vectors representing texture
coordinates diffuseColor += lightIntensity[3]*NdotL; command in the OpenGL API.
10. ^ bit-wise exclusive or

Built-In Variables [7] Tessellation Control (continued) Geometry Language Built-In Constants [7.3]
Shaders communicate with fixed-function Inputs (continued): The following built-in constants with minimum
Inputs: values are provided to all shaders. The actual
OpenGL pipeline stages and other shader in int gl_PatchVerticesIn; in gl_PerVertex {
executables through built-in input and output in int gl_PrimitiveID; values used are implementation- dependent, but
vec4 gl_Position;
variables. Redeclare matching subsets of these in int gl_InvocationID; float gl_PointSize; must be at least the value shown.
variables and blocks to establish matching float gl_ClipDistance[]; const int gl_MaxTextureUnits = 2;
interfaces when using multiple programs. Outputs: (... plus deprecated Vertex Language Outputs) const int gl_MaxTextureCoords = 8;
Vertex Language out gl_PerVertex { } gl_in[]; const int gl_MaxClipPlanes = 8;
Inputs:
vec4 gl_Position;
in int gl_PrimitiveIDIn;
const int gl_MaxVertexAttribs = 16;
float gl_PointSize; in int gl_InvocationID; const int gl_MaxVertexUniformComponents = 1024;
in int gl_VertexID; float gl_ClipDistance[]; const int gl_MaxVaryingFloats = 60;
in int gl_InstanceID; (... plus deprecated Vertex Language Outputs) const int gl_MaxVaryingComponents = 60;
in vec4 gl_Color; Outputs: const int gl_MaxVertexOutputComponents = 64;
} gl_out[]; out gl_PerVertex {
in vec4 gl_SecondaryColor; const int gl_MaxGeometryInputComponents = 64;
in vec3 gl_Normal; vec4 gl_Position;
patch out float gl_TessLevelOuter[4]; float gl_PointSize; const int gl_MaxGeometryOutputComponents = 128;
in vec4 gl_Vertex; patch out float gl_TessLevelInner[2]; float gl_ClipDistance[]; const int gl_MaxFragmentInputComponents = 128;
in vec4 gl_MultiTexCoordn // n is 0...7 (... plus deprecated Vertex Language Outputs) const int gl_MaxVertexTextureImageUnits = 16;
in float gl_FogCoord; }; const int gl_MaxCombinedTextureImageUnits = 80;
Outputs: Tessellation Evaluation Language const int gl_MaxTextureImageUnits = 16;
out gl_PerVertex { Inputs:
out int gl_PrimitiveID; const int gl_MaxFragmentUniformComponents = 1024;
out int gl_Layer; const int gl_MaxDrawBuffers = 8;
vec4 gl_Position; in gl_PerVertex { out int gl_ViewportIndex; const int gl_MaxClipDistances = 8;
float gl_PointSize; vec4 gl_Position; const int gl_MaxGeometryTextureImageUnits = 16;
float gl_ClipDistance[]; float gl_PointSize; const int gl_MaxGeometryOutputVertices = 256;
float gl_ClipDistance[];
Fragment Language
vec4 gl_ClipVertex; const int gl_MaxGeometryTotalOutputComponents = 1024;
vec4 gl_FrontColor; (... plus deprecated Vertex Language Outputs) Inputs: const int gl_MaxGeometryUniformComponents = 1024;
vec4 gl_BackColor; } gl_in[gl_MaxPatchVertices]; in vec4 gl_FragCoord; const int gl_MaxGeometryVaryingComponents = 64;
vec4 gl_FrontSecondaryColor; in bool gl_FrontFacing; const int gl_MaxTessControlInputComponents = 128;
in float gl_ClipDistance[]; const int gl_MaxTessControlOutputComponents = 128;
vec4 gl_BackSecondaryColor; in int gl_PatchVerticesIn; in vec2 gl_PointCoord;
vec4 gl_TexCoord[]; in int gl_PrimitiveID; const int gl_MaxTessControlTextureImageUnits = 16;
in int gl_PrimitiveID; const int gl_MaxTessControlUniformComponents = 1024;
float gl_FogFragCoord; in vec3 gl_TessCoord; in int gl_SampleID;
patch in float gl_TessLevelOuter[4]; in vec2 gl_SamplePosition; const int gl_MaxTessControlTotalOutputComponents = 4096;
}; const int gl_MaxTessEvaluationInputComponents = 128;
patch in float gl_TessLevelInner[2]; in float gl_FogFragCoord;
in vec4 gl_TexCoord[]; const int gl_MaxTessEvaluationOutputComponents = 128;
Tessellation Control Language in vec4 gl_Color; const int gl_MaxTessEvaluationTextureImageUnits = 16;
Inputs: Outputs: in vec4 gl_SecondaryColor; const int gl_MaxTessEvaluationUniformComponents = 1024;
in gl_PerVertex { out gl_PerVertex { const int gl_MaxTessPatchComponents = 120;
vec4 gl_Position; vec4 gl_Position; const int gl_MaxPatchVertices = 32;
Outputs: const int gl_MaxTessGenLevel = 64;
float gl_PointSize; float gl_PointSize; out vec4 gl_FragColor;
float gl_ClipDistance[]; float gl_ClipDistance[]; out vec4 gl_FragData[gl_MaxDrawBuffers]; const int gl_MaxViewports = 16;
(... plus deprecated Vertex Language Outputs) out float gl_FragDepth; const int gl_MaxVertexUniformVectors = 256;
(... plus deprecated Vertex Language Outputs) const int gl_MaxFragmentUniformVectors = 256;
} gl_in[gl_MaxPatchVertices]; }; out int gl_SampleMask[];
const int gl_MaxVaryingVectors = 15;

©2010 Khronos Group - Rev. 0610 www.opengl.org/registry


OpenGL Shading Language 4.10 Quick Reference Card - Page 8
Built-In Functions Common Functions (continued)
Type Abbreviations for Built-in Functions:
Angle & Trig. Functions [8.1] Tfd mix(Tfd x, Tfd y, Tfd a) Tf=float, vecn. Td =double, dvecn. Tfd= float, vecn, double, dvecn. Tb=bvecn, bool.
Functions will not result in a divide-by-zero Tf mix(Tf x, Tf y, float a) linear blend of x and y Tvec=vecn, uvecn, ivecn. Tu=uint, uvecn. Ti=int, ivecn. Tiu=int, ivecn, uint, uvecn.
error. If the divisor of a ratio is 0, then results Td mix(Td x, Td y, double a)
will be undefined. Component-wise operation. Use of Tn or Tnn within each function call must be the same. In vector types, n is 2, 3, or 4.
Parameters specified as angle are in units of true if comps. in a select
Tfd mix(Tfd x, Tfd y, Tb a) comps. from y, else from x
radians. Tf=float, vecn.
Geometric Functions (continued) Integer Functions (continued)
Tf radians(Tf degrees) degrees to radians Tfd step(Tfd edge, Tfd x)
Tf step(float edge, Tf x) 0.0 if x < edge, else 1.0 Tf normalize(Tf x) void umulExtended(
Tf degrees(Tf radians) radians to degrees Td step(double edge, Td x) normalize vector to length 1 Tu x, Tu y,
Td normalize(Td x)
out Tu msb,
Tf sin(Tf angle) sine Tb isnan(Tfd x) true if x is NaN out Tu lsb) Multiplies 32-bit integers x and y,
vec4 ftransform( ) invariant vertex transform
Tf cos(Tf angle) cosine void imulExtended( producing a 64-bit result.
true if x is positive or negative
Tb isinf(Tfd x) Tfd faceforward(Tfd N, returns N if dot(Nref, I) < 0, Ti x, Ti y,
infinity
Tf tan(Tf angle) tangent Tfd I, Tfd Nref) else -N out Ti msb,
Tfd clamp(Tfd x, Tfd minVal, out Ti lsb)
Tf asin(Tf x) arc sine Tfd maxVal) Tfd reflect(Tfd I, Tfd N) reflection direction I - 2 *
Tf clamp(Tf x, float minVal, Tiu bitfieldExtract( Extracts bits [offset, offset +
Tf acos(Tf x) arc cosine dot(N,I) * N Tiu value, bits - 1] from value, returns
float maxVal)
Td clamp(Td x, double minVal, int offset, int bits) them in the least significant bits
Tf atan(Tf y, Tf x) min(max(x, minVal), Tfd refract(Tfd I, Tfd N,
arc tangent double maxVal) refraction vector of the result.
Tf atan(Tf y_over_x) maxVal) float eta)
Tiu clamp(Tiu x, Tiu minVal,
Tiu maxVal) Tiu bitfieldInsert( Returns the insertion the bits
Tf sinh(Tf x) hyperbolic sine Ti clamp(Ti x, int minVal, int maxVal) Tiu base, Tiu insert, least-significant bits of insert
Tf cosh(Tf x) hyperbolic cosine Tu clamp(Tu x, uint minVal, Matrix Functions [8.6] int offset,int bits) into base.
uint maxVal) For the matrix functions, type mat is used in
the single-precision floating point functions, Tiu bitfieldReverse( Returns the reversal of the bits
Tf tanh(Tf x) hyperbolic tangent Tiu value) of value.
Tfd smoothstep(Tfd edge0, and type dmat is used in the double-precision
Tf asinh(Tf x) hyperbolic sine Tfd edge1, T x) floating point functions. Ti bitCount(Tiu value) Returns the number of bits
Tf smoothstep(float edge0, clip and N and M are 1, 2, 3, 4. set to 1.
Tf acosh(Tf x) hyperbolic cosine float edge1, Tf x) smooth
Td smoothstep(double edge0, mat matrixCompMult(mat x, mat y) Ti findLSB(Tiu value) Returns bit number of least
dmat matrixCompMult(dmat x, component-wise
Tf atanh(Tf x) hyperbolic tangent double edge1, Td x) multiply significant bit.
dmat y)
Returns signed int or uint value Ti findMSB(Tiu value) Returns bit number of most
Exponential Functions [8.2] Ti floatBitsToInt(Tf value)
representing the encoding of a matN outerProduct(vecN c, vecN r) significant bit.
Component-wise operation. Tf=float, vecn. Tu floatBitsToInt(Tf value) outer product
floating-point value. dmatN outerProduct(dvecN c,
Tfd= float, vecn, double, dvecn. (where N != M)
dvecN r) Texture Lookup Functions [8.9]
Tf pow(Tf x, Tf y) xy Returns floating-point value of a See next page
Tf intBitsToFloat(
signed int or uint encoding of a
Tiu value) matNxM outerProduct(vecM c, vecN r)
Tf exp(Tf x) ex floating-point value.
dmatNxM outerProduct(dvecM c, outer product Fragment Processing Functions [8.10]
Tf log(Tf x) ln Computes and returns a*b + c. dvecN r) Available only in fragment shaders.
Tfd fma(Tfd a, Tfd b, Tf=float, vecn.
Treated as a single operation
Tf exp2(Tf x) 2x Tfd c) matN transpose(matN m)
when using precise. transpose Derivative functions
dmatN transpose(dmatN m)
Tf log2(Tf x) log2 Tfd frexp(Tfd x, Splits x into a floating-point Tf dFdx(Tf p) derivative in x
out Ti exp) significand in the range [0.5, 1.0) matNxM transpose(matMxN m) transpose Tf dFdy(Tf p) derivative in y
Tfd sqrt(Tfd x) square root and an int. exp. of 2. dmatNxM transpose(dmatMxN m) (where N != M) sum of absolute derivative in
Tf fwidth(Tf p) x and y
Tfd inversesqrt(Tfd x) inverse square root Builds a floating-point number
Tfd ldexp(Tfd x, in Ti exp) from x and the corresponding float determinant(matN m) Interpolation functions
determinant
Common Functions [8.3] integral exponent of 2 in exp. double determinant(dmatN m)
Component-wise operation. Tf=float, vecn. Tf interpolateAtCentroid( Return value of interpolant
sampled inside pixel and the
Tfd= float, vecn, double, dvecn. matN inverse(matN m) Tf interpolant) primitive.
inverse
Tfd abs(Tfd x) Floating-Point Pack/Unpack [8.4] dmatN inverse(dmatN m) Tf interpolateAtSample( Return value of interpolant
absolute value These do not operate component-wise.
Ti abs(Ti x) Tf interpolant, at the location of sample
Converts each comp. of v int sample) number sample.
Tfd sign(Tfd x) returns -1.0, 0.0, or 1.0 uint packUnorm2x16(vec2 v) Vector Relational Functions [8.7]
Ti sign(Ti x) into 8- or 16-bit ints, packs Compare x and y component-wise. Sizes of the Tf interpolateAtOffset( Return value of interpolant
uint packUnorm4x8(vec4 v)
results into the returned 32-bit input and return vectors for any particular call Tf interpolant, sampled at fixed offset offset
uint packSnorm4x8(vec4 v)
Tfd floor(Tfd x) nearest integer <= x unsigned integer. must match. Tvec=vecn, uvecn, ivecn. vec2 offset) pixel center.
nearest integer with absolute vec2 unpackUnorm2x16 Unpacks 32-bit p into two bvecn lessThan(Tvec x, Tvec y) <
Tfd trunc(Tfd x) value <= absolute value of x (uint p) 16-bit uints, four 8-bit uints, or Noise Functions [8.11]
vec4 unpackUnorm4x8 signed ints. Then converts each bvecn lessThanEqual(Tvec x, Tvec y) <= Returns noise value. Available to fragment,
nearest integer, geometry, and vertex shaders.
Tfd round(Tfd x) implementation-dependent (uint p) component to a normalized
bvecn greaterThan(Tvec x, Tvec y) > float noise1(Tf x)
rounding mode vec4 unpackSnorm4x8 float to generate a 2- or
(uint p) 4-component vector. bvecn greaterThanEqual(Tvec x, Tvec y) >= vecn noisen(Tf x) where n is 2, 3, or 4
nearest integer, 0.5 rounds
Tfd roundEven(Tfd x) to nearest even integer Packs components of v into bvecn equal(Tvec x, Tvec y) == Geometry Shader Functions [8.12]
double packDouble2x32
a 64-bit value and returns a bvecn equal(bvecn x, bvecn y) Only available in geometry shaders.
Tfd ceil(Tfd x) nearest integer >= x (uvec2 v)
double-precision value.
Emits values of output
Tfd fract(Tfd x) x - floor(x) bvecn notEqual(Tvec x, Tvec y) != void EmitStreamVertex( variables to the current
uvec2 unpackDouble2x32 Returns a 2-component vector bvecn notEqual(bvecn x, bvecn y) int stream) output primitive stream
Tfd mod(Tfd x, Tfd y) (double v) representation of v. stream.
Tf mod(Tf x, float y) modulus true if any component of x
bool any(bvecn x)
Td mod(Td x, double y) is true void EndStreamPrimitive( Completes current output
Geometric Functions [8.5] int stream)
primitive stream stream
separate integer and fractional These functions operate on vectors as vectors, not true if all components of x and starts a new one.
Tfd modf(Tfd x, out Tfd i) bool all(bvecn x)
parts component-wise. Tf=float, vecn. Td =double, dvecn. are true
Tfd= float, vecn, double, dvecn. Emits values of output
Tfd min(Tfd x, Tfd y) bvecn not(bvecn x) logical complement of x void EmitVertex() variables to the current
Tf min(Tf x, float y) float length(Tf x) output primitive.
Td min(Td x, double y) double length(Td x) length of vector
minimum value Integer Functions [8.8] Completes output
Tiu min(Tiu x, Tiu y)
Ti min(Ti x, int y) Component-wise operation. Tu=uint, uvecn. void EndPrimitive() primitive and starts a
float distance(Tf p0, Tf p1) Ti=int, ivecn. Tiu=int, ivecn, uint, uvecn. new one.
Tu min(Tu x, uint y) double distance(Td p0, Td p1) distance between points
Tfd max(Tfd x, Tfd y) Tu uaddCarry(Tu x, Adds 32-bit uintx and y, returning
float dot(Tf x, Tf y) Tu y, out Tu carry) the sum modulo 232. Shader Invocation Control [8.13]
Tf max(Tf x, float y) dot product Controls execution order of shader invocations.
Td max(Td x, double y) double dot(Td x, Td y)
maximum value Tu usubBorrow( Subtracts y from x, returning Available only to tessellation control shaders.
Tiu max(Tiu x, Tiu y)
Ti max(Ti x, int y) vec3 cross(vec3 x, vec3 y) Tu x, Tu y, the difference if non-negative, Synchronizes across shader
cross product void barrier()
Tu max(Tu x, uint y) dvec3 cross(dvec3 x, dvec3 y) out Tu borrow) otherwise 232 plus the difference. invocations.

©2010 Khronos Group - Rev. 0210


0610 www.opengl.org/registry
OpenGL Shading Language 4.10 Quick Reference Card - Page 9
Texture Functions [8.9] Offset added before texture lookup as in texture. Projective texture lookup with explicit LOD.
See textureLod and textureOffset.
Texture lookup projectively, with gradient (continued)
Available to vertex, geometry, and fragment gvec4 textureOffset(gsampler1D sampler, float P, int offset gvec4 textureProjGrad(gsampler3D sampler, vec4 P,
shaders. gvec4=vec4, ivec4, uvec4. [, float bias]) gvec4 textureProjLod(gsampler1D sampler, vec{2,4} P, vec3 dPdx, vec3 dPdy)
gsampler* =sampler*, isampler*, usampler*. float lod)
gvec4 textureOffset(gsampler2D sampler, vec2 P, gvec4 textureProjGrad(gsampler2DRect sampler, vec{3,4} P,
Texture Query [8.9.1] ivec2 offset [, float bias]) gvec4 textureProjLod(gsampler2D sampler, vec{3,4} P, vec2 dPdx, vec2 dPdy)
int textureSize(gsampler1D sampler, int lod) gvec4 textureOffset(gsampler3D sampler, vec3 P, float lod) float textureProjGrad(sampler2DRectShadow sampler,
ivec2 textureSize(gsampler2D sampler, int lod) ivec3 offset [, float bias]) gvec4 textureProjLod(gsampler3D sampler, vec4 P, float lod) vec4 P, vec2 dPdx, vec2 dPdy)
ivec3 textureSize(gsampler3D sampler, int lod) gvec4 textureOffset(gsampler2DRect sampler, vec2 P, float textureProjLod(sampler{1,2}DShadow sampler, float textureProjGrad(sampler1DShadow sampler, vec4 P,
ivec2 textureSize(gsamplerCube sampler, int lod) ivec2 offset) vec4 P, float lod) float dPdx, float dPdy)
int textureSize(sampler1DShadow sampler, int lod) float textureOffset(sampler2DRectShadow sampler, float textureProjGrad(sampler2DShadow sampler, vec4 P,
ivec2 textureSize(sampler2DShadow sampler, int lod) vec3 P, ivec2 offset) vec2 dPdx, vec2 dPdy)
float textureOffset(sampler1DShadow sampler, vec3 P, Offset projective texture lookup with explicit LOD.
ivec2 textureSize(samplerCubeShadow sampler, int lod)
int offset [, float bias]) See textureProj, textureLod, and textureOffset.
ivec3 textureSize(samplerCubeArray sampler, int lod) Texture lookup projectively and with explicit gradient
ivec3 textureSize(samplerCubeArrayShadow sampler, int lod) float textureOffset(sampler2DShadow sampler, vec3 P, gvec4 textureProjLodOffset(gsampler1D sampler, vec{2,4} as in textureProjGrad, as well as with offset as in
ivec2 textureSize(gsampler2DRect sampler) ivec2 offset [, float bias]) P, float lod, int offset) textureOffset.
ivec2 textureSize(sampler2DRectShadow sampler) gvec4 textureOffset(gsampler1DArray sampler, vec2 P, gvec4 textureProjLodOffset(gsampler2D sampler, vec{3,4}
int offset [, float bias]) P, float lod, ivec2 offset) gvec4 textureProjGradOffset(gsampler1D sampler,
ivec2 textureSize(gsampler1DArray sampler, int lod) vec{2,4} P, float dPdx, float dPdy, int offset)
ivec3 textureSize(gsampler2DArray sampler, int lod) gvec4 textureOffset(gsampler2DArray sampler, vec3 P, gvec4 textureProjLodOffset(gsampler3D sampler, vec4 P,
ivec2 offset [, float bias]) float lod, ivec3 offset) gvec4 textureProjGradOffset(gsampler2D sampler,
ivec2 textureSize(sampler1DArrayShadow sampler, int lod) vec{3,4} P, vec2 dPdx, vec2 dPdy, vec2 offset)
ivec3 textureSize(sampler2DArrayShadow sampler, int lod) float textureOffset(sampler1DArrayShadow sampler, float textureProjLodOffset(sampler1DShadow sampler,
vec3 P, int offset [, float bias]) vec4 P, float lod, int offset) gvec4 textureProjGradOffset(gsampler2DRect sampler,
int textureSize(gsamplerBuffer sampler) vec{3,4} P, vec2 dPdx, vec2 dPdy, ivec2 offset)
ivec2 textureSize(gsampler2DMS sampler) float textureProjLodOffset(sampler2DShadow sampler,
Use integer texture coordinate P to lookup a single vec4 P, float lod, ivec2 offset) float textureProjGradOffset(sampler2DRectShadow
ivec2 textureSize(gsampler2DMSArray sampler) texel from sampler. sampler, vec4 P, vec2 dPdx, vec2 dPdy, ivec2 offset)
vec2 textureQueryLod(gsampler1D sampler, float P)
gvec4 texelFetch(gsampler1D sampler, int P, int lod) gvec4 textureProjGradOffset(gsampler3D sampler, vec4 P,
vec2 textureQueryLod(gsampler2D sampler, vec2 P) Texture lookup as in texture but with explicit gradients. vec3 dPdx, vec3 dPdy, vec3 offset)
vec2 textureQueryLod(gsampler3D sampler, vec3 P) gvec4 texelFetch(gsampler2D sampler, ivec2 P, int lod)
gvec4 texelFetch(gsampler3D sampler, ivec3 P, int lod) gvec4 textureGrad(gsampler1D sampler, float P, float dPdx, float textureProjGradOffset(sampler1DShadow sampler,
vec2 textureQueryLod(gsamplerCube sampler, vec3 P) vec4 P, float dPdx, float dPdy, int offset)
float dPdy)
vec2 textureQueryLod(gsampler1DArray sampler, float P) gvec4 texelFetch(gsampler2DRect sampler, ivec2 P)
gvec4 textureGrad(gsampler2D sampler, vec2 P, vec2 dPdx, float textureProjGradOffset(sampler2DShadow sampler,
vec2 textureQueryLod(gsampler2DArray sampler, vec2 P) gvec4 texelFetch(gsampler1DArray sampler, ivec2 P, int lod) vec4 P, vec2 dPdx, vec2 dPdy, vec2 offset)
vec2 dPdy)
vec2 textureQueryLod(gsamplerCubeArray sampler, vec3 P) gvec4 texelFetch(gsampler2DArray sampler, ivec3 P, int lod)
vec2 textureQueryLod(sampler1DShadow sampler, float P) gvec4 textureGrad(gsampler3D sampler, vec3 P, vec3 dPdx,
gvec4 texelFetch(gsamplerBuffer sampler, int P) vec3 dPdy)
vec2 textureQueryLod(sampler2DShadow sampler, vec2 P) Texture Gather Instructions [8.9.3]
vec2 textureQueryLod(samplerCubeShadow sampler, vec3 P) gvec4 texelFetch(gsampler2DMS sampler, ivec2 P, int sample) gvec4 textureGrad(gsamplerCube sampler, vec3 P,
vec3 dPdx, vec3 dPdy)
Texture gather operation.
vec2 textureQueryLod(sampler1DArrayShadow sampler, gvec4 texelFetch(gsampler2DMSArray sampler, ivec3 P,
int sample) gvec4 textureGrad(gsampler2DRect sampler, vec2 P, gvec4 textureGather(gsampler2D sampler, vec2 P
float P) [, int comp])
vec2 textureQueryLod(sampler2DArrayShadow sampler, vec2 dPdx, vec2 dPdy)
vec2 P) float textureGrad(sampler2DRectShadow sampler, vec3 P, gvec4 textureGather(gsampler2DArray sampler, vec3 P
Fetch single texel as in texelFetch offset by offset as [, int comp])
vec2 textureQueryLod(samplerCubeArrayShadow sampler, described in textureOffset. vec2 dPdx, vec2 dPdy)
vec3 P) float textureGrad(sampler1DShadow sampler, vec3 P, gvec4 textureGather(gsamplerCube sampler, vec3 P
gvec4 texelFetchOffset(gsampler1D sampler, int P, int lod, float dPdx, float dPdy) [, int comp])
Texel Lookup Functions [8.9.2] int offset) float textureGrad(sampler2DShadow sampler, vec3 P,
gvec4 textureGather(gsamplerCubeArray sampler,
Use texture coordinate P to do a lookup in the texture gvec4 texelFetchOffset(gsampler2D sampler, ivec2 P, vec4 P[, int comp])
vec2 dPdx, vec2 dPdy)
bound to sampler. int lod, ivec2 offset) gvec4 textureGather(gsampler2DRect sampler, vec3 P
gvec4 texture(gsampler1D sampler, float P [, float bias]) gvec4 textureGrad(gsampler1DArray sampler, vec2 P,
gvec4 texelFetchOffset(gsampler3D sampler, ivec3 P, [, int comp])
float dPdx, float dPdy)
gvec4 texture(gsampler2D sampler, vec2 P [, float bias]) int lod, ivec3 offset) vec4 textureGather(sampler2DShadow sampler, vec2 P,
gvec4 textureGrad(gsampler2DArray sampler, vec3 P, float refZ)
gvec4 texture(gsampler3D sampler, vec3 P [, float bias]) gvec4 texelFetchOffset(gsampler2DRect sampler, ivec2 P, vec2 dPdx, vec2 dPdy)
gvec4 texture(gsamplerCube sampler, vec3 P [, float bias]) ivec2 offset) vec4 textureGather(sampler2DArrayShadow sampler,
float textureGrad(sampler1DArrayShadow sampler, vec3 P, vec3 P, float refZ)
float texture(sampler{1D,2D}Shadow sampler, vec3 P gvec4 texelFetchOffset(gsampler1DArray sampler, ivec2 P, float dPdx, float dPdy)
[, float bias]) int lod, int offset) vec4 textureGather(samplerCubeShadow sampler,
float textureGrad(sampler2DArrayShadow sampler, vec4 P, vec3 P, float refZ)
float texture(samplerCubeShadow sampler, vec4 P gvec4 texelFetchOffset(gsampler2DArray sampler, ivec3 P, vec2 dPdx, vec2 dPdy)
[, float bias]) int lod, ivec2 offset) vec4 textureGather(samplerCubeArrayShadow sampler,
gvec4 textureGrad(gsamplerCubeArray sampler, vec4 P, vec4 P, float refZ)
gvec4 texture(gsampler1DArray sampler, vec2 P
[, float bias]) vec3 dPdx, vec3 dPdy)
Projective lookup as described in textureProj offset by vec4 textureGather(sampler2DRectShadow sampler,
gvec4 texture(gsampler2DArray sampler, vec3 P offset as described in textureOffset. vec2 P, float refZ)
[, float bias]) Texture lookup with both explicit gradient and offset,
gvec4 texture(gsamplerCubeArray sampler, vec4 P gvec4 textureProjOffset(gsampler1D sampler, vec{2,4} P, Texture gather as in textureGather by offset as
int offset [, float bias])
as described in textureGrad and textureOffset.
[, float bias]) described in textureOffset except minimum and
float texture(sampler1DArrayShadow sampler, vec3 P gvec4 textureProjOffset(gsampler2D sampler, vec{3,4} P, gvec4 textureGradOffset(gsampler1D sampler, float P, maximum offset values are given by
[, float bias]) ivec2 offset [, float bias]) float dPdx, float dPdy, int offset) {MIN, MAX}_PROGRAM_TEXTURE_GATHER_OFFSET.
float texture(sampler2DArrayShadow sampler, vec4 P) gvec4 textureProjOffset(gsampler3D sampler, vec4 P, gvec4 textureGradOffset(gsampler2D sampler, vec2 P, gvec4 textureGatherOffset(gsampler2D sampler, vec2 P,
gvec4 texture(gsampler2DRect sampler, vec2 P) ivec3 offset [, float bias]) vec2 dPdx, vec2 dPdy, ivec2 offset) ivec2 offset [, int comp])
float texture(sampler2DRectShadow sampler, vec3 P) gvec4 textureProjOffset(gsampler2DRect sampler, gvec4 textureGradOffset(gsampler3D sampler, vec3 P, gvec4 textureGatherOffset(gsampler2DArray sampler,
vec{3,4} P, ivec2 offset) vec3 dPdx, vec3 dPdy, ivec3 offset) vec3 P, ivec2 offset [, int comp])
float texture(gsamplerCubeArrayShadow sampler, vec4 P,
float compare) float textureProjOffset(sampler2DRectShadow sampler, gvec4 textureGradOffset(gsampler2DRect sampler, vec2 P, gvec4 textureGatherOffset(gsampler2DRect sampler,
vec4 P, ivec2 offset) vec2 dPdx, vec2 dPdy, ivec2 offset) vec3 P, ivec2 offset [, int comp])
Texture lookup with projection. float textureProjOffset(sampler1DShadow sampler, vec4 P, float textureGradOffset(sampler2DRectShadow sampler, vec4 textureGatherOffset(sampler2DShadow sampler,
gvec4 textureProj(gsampler1D sampler, vec{2,4} P int offset [, float bias]) vec3 P, vec2 dPdx, vec2 dPdy, ivec2 offset) vec2 P, float refZ, ivec2 offset)
[, float bias]) float textureProjOffset(sampler2DShadow sampler, vec4 P, float textureGradOffset(sampler1DShadow sampler, vec4 textureGatherOffset(sampler2DArrayShadow
gvec4 textureProj(gsampler2D sampler, vec{3,4} P ivec2 offset [, float bias]) vec3 P, float dPdx, float dPdy, int offset) sampler, vec3 P, float refZ, ivec2 offset)
[, float bias]) float textureGradOffset(sampler2DShadow sampler, vec4 textureGatherOffset(sampler2DRectShadow sampler,
gvec4 textureProj(gsampler3D sampler, vec4 P [, float bias]) Offset texture lookup with explicit LOD. vec3 P, vec2 dPdx, vec2 dPdy, ivec2 offset) vec2 P, float refZ, ivec2 offset)
float textureProj(sampler{1D,2D}Shadow sampler, See textureLod and textureOffset.
vec4 P [, float bias]) gvec4 textureGradOffset(gsampler1DArray sampler, vec2 P,
gvec4 textureLodOffset(gsampler1D sampler, float P, float dPdx, float dPdy, int offset) Texture gather as in textureGatherOffset except that
gvec4 textureProj(gsampler2DRect sampler, vec{3,4} P)
float textureProj(sampler2DRectShadow sampler, vec4 P) float lod, int offset) gvec4 textureGradOffset(gsampler2DArray sampler, vec3 P, offsets is used to determine the location of the four
gvec4 textureLodOffset(gsampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy, ivec2 offset) texels to sample.
Texture lookup as in texture but with explicit LOD. float lod, ivec2 offset) float textureGradOffset(sampler1DArrayShadow sampler, gvec4 textureGatherOffsets(gsampler2D sampler, vec2 P,
gvec4 textureLod(gsampler1D sampler, float P, float lod) gvec4 textureLodOffset(gsampler3D sampler, vec3 P, vec3 P, float dPdx, float dPdy, int offset) ivec2 offset[4] [, int comp])
float lod, ivec3 offset) float textureGradOffset(sampler2DArrayShadow sampler,
gvec4 textureLod(gsampler2D sampler, vec2 P, float lod) gvec4 textureGatherOffsets(gsampler2DArray sampler,
float textureLodOffset(sampler1DShadow sampler, vec3 P, vec4 P, vec2 dPdx, vec2 dPdy, ivec2 offset)
gvec4 textureLod(gsampler3D sampler, vec3 P, float lod) float lod, int offset) vec3 P, ivec2 offset[4] [, int comp])
gvec4 textureLod(gsamplerCube sampler, vec3 P, float lod) gvec4 textureGatherOffsets(gsampler2DRect sampler,
float textureLodOffset(sampler2DShadow sampler, vec3 P,
float textureLod(sampler{1D,2D}Shadow sampler, float lod, ivec2 offset) Texture lookup both projectively as in textureProj, and vec3 P, ivec2 offset[4][, int comp])
vec3 P, float lod) with explicit gradient as in textureGrad. vec4 textureGatherOffsets(sampler2DShadow sampler,
gvec4 textureLod(gsampler1DArray sampler, vec2 P, float lod) gvec4 textureLodOffset(gsampler1DArray sampler, vec2 P,
float lod, int offset) gvec4 textureProjGrad(gsampler1D sampler, vec{2,4} P, vec2 P, float refZ, ivec2 offset[4])
gvec4 textureLod(gsampler2DArray sampler, vec3 P, float lod)
gvec4 textureLodOffset(gsampler2DArray sampler, vec3 P, float dPdx, float dPdy) vec4 textureGatherOffsets(sampler2DArrayShadow
float textureLod(sampler1DArrayShadow sampler,
vec3 P, float lod) float lod, ivec2 offset) gvec4 textureProjGrad(gsampler2D sampler, vec{3,4} P, sampler, vec3 P, float refZ, ivec2 offset[4])
gvec4 textureLod(gsamplerCubeArray sampler, vec4 P, float textureLodOffset(sampler1DArrayShadow sampler, vec2 dPdx, vec2 dPdy) vec4 textureGatherOffsets(sampler2DRectShadow
float lod) vec3 P, float lod, int offset) (more ) sampler, vec2 P, float refZ, ivec2 offset[4])

©2010 Khronos Group - Rev. 0610 www.opengl.org/registry


OpenGL 4.1 API Quick Reference Card - Page 10
OpenGL Reference Card Index
The following index shows each item included on this card along with the page on which it is described. The color of the row in the table below is the color of the pane to which you should refer.
A DeleteVertexArrays 1 GetError 1 Load{Transpose}Matrix* 2 S
Accum 4 DepthFunc 5 GetFloat* 6 LoadName 5 SampleCoverage 5
ActiveShaderProgram 2 DepthMask 4 GetFragData{Index, Location} 3 Load Uniform Variables 2 SampleMaski 5
ActiveTexture 4 DepthRange{Arrayv, Indexed}* 2 GetFramebufferAttachment Logical Operation 5 SamplerParameter* 4
AlphaFunc 5 Derivative functions 8 Parameter* 5 LogicOp 5 Scale* 2
Angle Functions 8 DetachShader 2 GetHistogram{Parameter}* 3 Scissor{Indexed}* 5
AreTexturesResident 4 Display Lists 5 GetInteger* 6 M ScissorArrayv 5
Array Constructor 7 Dithering 5 GetInteger64v 5 Macros 6 SecondaryColor{P}3 1
ArrayElement 1 DrawArrays{Instanced, Indirect} 1 GetIntegerv 3 Map{Grid}* 5 SecondaryColorPointer 1
AttachShader 2 DrawBuffer{s} 4 GetLight* 2 MapBuffer{Range} 1 SelectBuffer 5
DrawElements{Indirect, Instanced} 1 GetMap* 5 Material* 2 SeparableFilter2D 3
B GetMaterial* 2 Matrices 2
Begin 1 DrawElementsBaseVertex 1 ShadeModel 2
DrawElementsInstanced BaseVertex 1 GetMinmax{Parameter}* 3 Matrix Component Examples 7 Shader Execution 3
BeginConditionalRender 2 Matrix Functions 8
DrawPixels 4 GetMultisamplefv 3 Shader Invocation Control 8
BeginQuery{Indexed} 2 MatrixMode 2
DrawRangeElements {BaseVertex} 1 GetPixelMap* 3 Shader Queries 3
BeginQuery 5 Minmax 3
DrawTransformFeedback {Stream} 2 GetPointerv 6 Shader{Binary, Source} 2
BeginTransformFeedback 2 MinSampleShading 3
GetPolygonStipple 3 State and State Requests 6
BindAttribLocation 2 E Mult{Transpose}Matrix* 2
GetProgramBinary 2 StencilFunc{Separate} 5
BindBuffer{Base, Range} 1 EdgeFlagPointer 1 MultiDraw{Arrays, Elements} 1
GetProgramInfoLog 3 StencilMask{Separate} 4
BindFramebuffer 5 EdgeFlag{v} 1 MultiDrawElementsBaseVertex 1
GetProgramiv 3 StencilOp{Separate} 5
BindFragDataLocation{Indexed} 3 EnableClientState 1 Multisample Fragment 5
GetProgramPipeline*{InfoLog} 3 Stippling 3
BindProgramPipeline 2 EnableVertexAttribArray 1 Multisampling 3
GetProgramStageiv 3 Storage Qualifiers 6
BindRenderbuffer 5 End 1 MultiTexCoord{P}* 1
GetQuery* 2 Structure & Array Operations 7
BindSampler 4 EndList 5 GetRenderbufferParameter* 5 Structure Constructor 7
BindTexture 4 Enumerated Query 5 N
GetSamplerParameter* 5 Subroutine Uniform Variables 2
BindTransformFeedback 2 Eval{Coord, Mesh, Point}* 5 NewList 5
GetSeparableFilter 3 Subroutines 7
BindVertexArray 1 Evaluators 5 Noise Functions 8
GetShader*{InfoLog} 3 Synchronization 5
Bitmap 4 Exponential Functions 8 Normal{P}3* 1
GetShaderPrecisionFormat 3
BlendColor 5 NormalPointer 1
GetShaderSource 3 T
BlendEquation{Separate}* 5 F GetString* 6
BlendFunc{Separate}* 5 Feedback{Buffer} 5 Tessellation Control Shaders 3
GetSubroutineIndex 2 O Tex{Sub}Image* 4
BlitFramebuffer 6 FenceSync 5 Occlusion Queries 5
GetSubroutineUniformLocation 2 TexBuffer 4
Buffer{Sub}Data 1 Finish 5 OpenGL Shading Language 5
GetSync* 5 TexCoord{P}* 1
Flatshading 2 GetTex{Env, Gen}* 4 Ortho 2
C Floating-point Numbers 1 TexCoordPointer 1
CallList{s} 5 Floating-Point Pack/Unpack Func. GetTexImage 5 Texel/Texture Lookup Functions 9
8 GetTex{Level}Parameter* 4 P
CheckFramebufferStatus 5 Flush 5 TexEnv* 4
GetTransformFeedbackVarying 3 Parameter Qualifiers 7 TexGen* 2
ClampColor 2,4 FlushMappedBufferRange 1 PassThrough 5
Clear 4 Fog* GetUniform* 3 Tex{Sub}Image{1D, 2D, 3D} 4
4 GetUniformBlockIndex 2 PatchParameterfv 3
ClearAccum 4 FogCoord* 1 TexImage{2 3}DMultisample 4
GetUniformIndices 2 PatchParameteri 1 TexParameter* 4
ClearBuffer* 4 FogCoordPointer 1 PauseTransformFeedback 2
ClearColor 4 Fragment Operations GetUniformLocation 2 Texture Coordinates 2
5 GetUniformSubroutineuiv 3 Pixel{Map, Store, Transfer}* 3
ClearDepth{f} 4 Fragment Processing Functions 8 Texture Functions 9
GetVertexAttrib*{Pointerv} 3 PixelZoom 4 Texture Queries 9
ClearIndex 4 Fragment Shaders 3 Pointer & String Queries 6
ClearStencil 4 Framebuffer GL Command Syntax 1 Texturing 4
4 PointParameter* 3
ClientActiveTexture 1 FramebufferRenderbuffer 5 Timer Queries 5
H PointSize 3 TransformFeedbacks 2
ClientWaitSync 5 FramebufferTexture* 5 Polygon{Mode, Offset} 3
Hint 4 TransformFeedbackVaryings 3
Clipping 2 FramebufferTextureLayer 5 PolygonStipple 3
Histogram 3 Translate* 2
ClipPlane 2 FrontFace 3 Precise & Precision Qualifiers 7
Color{P}* 1 Frustum 2 Trigonometry Functions 8
I Predefined Macros 5 Types 6
ColorMask{i} 4 Implicit Conversions 6 Preprocessor 6
ColorMaterial 2 G Index* 1 PrimitiveRestartIndex 1
ColorPointer 1 GenBuffers 1 U
IndexMask 4 PrioritizeTextures 4
Color{Sub}Table 3 GenerateMipmap 4 Uniform Buffer Object Bindings 2
IndexPointer 1 Program Objects 2
ColorTableParameter* 3 GenFramebuffers 5 Uniform Qualifiers 6
InitNames 5 Program Pipeline 2
Command Letters 1 GenLists 5 Uniform Variables 2
Integer Functions 8 Program Queries 3
Common Functions 8 GenProgramPipelines 2 Uniform* 2
InterleavedArrays 1 ProgramBinary 2
CompileShader 2 GenQueries 2 Uniform-Block Layout Qualifiers 7
Interpolation Functions 8 ProgramParameteri 2
CompressedTex{Sub}Image* 4 GenRenderbuffers 5 UniformBlockBinding 2
Interpolation Qualifiers 7 ProgramUniform{Matrix}* 2
Constants 7 GenSamplers 4 UniformMatrix* 2
Invariant Qualifiers 7 ProvokingVertex 2
ConvolutionFilter* 3 GenTextures 4 UniformSubroutines* 3
IsBuffer 1 {Push, Pop}Attrib 6
ConvolutionParameter* 4 GenTransformFeedbacks 2 UnmapBuffer 1
IsEnabled* 6 {Push, Pop}ClientAttrib 6
CopyBufferSubData 1 GenVertexArrays 1 UseProgram{Stages} 2
IsFramebuffer 5 {Push, Pop}Matrix 2
CopyColor{Sub}Table 3 Geometric Functions 8
IsList 5 {Push, Pop}Name 5
CopyConvolutionFilter* 3 Geometry Shader Functions 8 V
IsProgram{Pipeline} 3 ValidateProgram{Pipeline} 3
CopyPixels 6 GetActiveAttrib 2
IsQuery 2 Q
CopyTex{Sub}Image*D 4 GetActiveSubroutineName 2 Qualifiers 6,7 Variables 7
IsRenderbuffer 5 Varying Variables 3
CreateProgram 2 GetActive{Subroutine}Uniform* 2
IsSampler 5 QueryCounter 5
CreateShader{Program} 2 GetActiveSubroutineUniform Vector & Matrix Constructors 7
2 IsShader 3 Vector Relational Functions 8
CullFace 3 Name IsSync 5 R
GetActiveUniform* 2 Rasterization 3 Vertex Arrays 1
IsTexture 5
D GetAttachedShaders 3 RasterPos* 2 Vertex Attributes 2
IsTransformFeedback 2 Vertex{P}* 1
DeleteBuffers 1 GetAttribLocation 2 ReadBuffer 6
IsVertexArray 1 VertexAttrib* 1
DeleteFramebuffers 5 GetBoolean* 6 ReadPixels 6
Iteration and Jumps 7 VertexAttrib{Divisor} 1
DeleteLists 5 GetBufferParameter* 1 Rect* 2
DeleteProgram{Pipelines} 2 GetBufferPointerv 1 L Rectangles 2 VertexAttrib{I,L}Pointer 1
DeleteQueries 2 GetBufferSubData 1 Layout Qualifiers 6 ReleaseShaderCompiler 2 VertexPointer 1
DeleteRenderbuffers 5 GetClipPlane 2 Light* 2 RenderbufferStorage{Multisample} 5 Viewport 2
DeleteSamplers 4 GetColorTable{Parameter}* 3 LightModel* 2 RenderMode 5 Viewport{Arrayv, Indexed*} 2
DeleteShader 2 GetCompressedTexImage 5 Line{Stipple, Width} 3 ResetHistogram 3
DeleteSync 5 GetConvolutionFilter 3 LinkProgram 2 ResetMinmax 3 W
DeleteTextures 4 GetConvolutionParameter* 3 ListBase 5 ResumeTransformFeedback 2 WaitSync 5
DeleteTransformFeedbacks 2 GetDoublev 6 LoadIdentity 2 Rotate* 2 WindowPos* 2

OpenGL is a registered trademark of Silicon Graphics International, used under license by Khronos Group.
The Khronos Group is an industry consortium creating open standards for the authoring and acceleration
of parallel computing, graphics and dynamic media on a wide variety of platforms and devices.
See www.khronos.org to learn more about the Khronos Group.
See www.opengl.org to learn more about OpenGL.

©2010 Khronos Group - Rev. 0610 Reference card production by Miller & Mattson www.millermattson.com www.opengl.org/registry

You might also like