www.opengl.org/registry ©2011 Khronos Group - Rev. 0711
OpenGL 4.2 API Reference Card Page 3
Rasterizaon [3]
Enable/Disable(target)
target: RASTERIZER_DISCARD, MULTISAMPLE,
SAMPLE_SHADING
Mulsampling [3.3.1]
Use to analias points, lines, polygons,
bitmaps, and images.
void GetMulsamplefv(enum pname,
uint index, oat *val);
pname: SAMPLE_POSITION
void MinSampleShading(clampf value);
Points [3.4]
void PointSize(oat size);
void PointParameter{if}(enum pname,
T param);
void PointParameter{if}v(enum pname, const
T params);
pname: POINT_SIZE_MIN, POINT_SIZE_MAX,
POINT_DISTANCE_ATTENUATION,
POINT_FADE_THRESHOLD_SIZE,
POINT_SPRITE_COORD_ORIGIN
param, params: The clamp bounds, if pname is
POINT_SIZE_{MIN, MAX};
A
pointer to coecients a, b, and c, if pname is
POINT_DISTANCE_ATTENUATION;
The
fade threshold if pname is
POINT_FADE_THRESHOLD_SIZE;
{LOWER|UPPER}_LEFT if pname is
POINT_SPRITE_COORD_ORIGIN.
LOWER_LEFT,
UPPER_LEFT,
pointer to point fade threshold
Enable/Disable
(target)
target:
VERTEX_PROGRAM_POINT_SIZE,
POINT_SMOOTH, POINT_SPRITE.
Line Segments [3.5]
void LineWidth(oat width);
Enable/Disable(LINE_SMOOTH)
Other Line Seg. Features [3.5.2]
void LineSpple(int factor, ushort paern);
Enable/Disable(LINE_STIPPLE)
void GetIntegerv(LINE_STIPPLE_PATTERN);
Polygons [3.6]
Enable/Disable(target)
target: POLYGON_STIPPLE, POLYGON_SMOOTH,
CULL_FACE
void FrontFace(enum dir);
dir: CCW, CW
void CullFace(enum mode);
mode: FRONT, BACK, FRONT_AND_BACK
Sppling [3.6.2, 6.1.6]
void PolygonSpple(const ubyte *paern);
void GetPolygonSpple(void *paern);
Polygon Rasterizaon & Depth Oset
[3.6.3 - 3.6.4] [3.6.4 - 3.6.5]
void PolygonMode(enum face, enum mode);
face: FRONT, BACK, FRONT_AND_BACK
mode: POINT, LINE, FILL
void PolygonOset(oat factor, oat units);
Enable/Disable(target)
target: POLYGON_OFFSET_{POINT, LINE, FILL}
Pixel Storage Modes [3.7.1]
void PixelStore{if}(enum pname, T param);
pname: {UN}PACK_x (where x may be SWAP_BYTES,
LSB_FIRST, ROW_LENGTH, SKIP_{PIXELS, ROWS},
ALIGNMENT, IMAGE_HEIGHT, SKIP_IMAGES),
UNPACK_COMPRESSED_BLOCK_{WIDTH, HEIGHT,
DEPTH, SIZE}
Pixel Transfer Modes [3.7.3, 6.1.3]
void PixelTransfer{if}(enum param, T value);
param: MAP_{COLOR, STENCIL}, x_ {SCALE, BIAS},
INDEX_{SHIFT, OFFSET}, DEPTH_{SCALE, BIAS},
POST_CONVOLUTION_x_{SCALE, BIAS},
POST_COLOR_MATRIX_x_{SCALE, BIAS}, (where
x is RED, GREEN, BLUE, or ALPHA)
[Table 3.2]
void PixelMap{ui us f}v(enum map, sizei size,
const T values);
map: PIXEL_MAP_x_TO_x (where x may be
{I,S,R,G,B,A}), PIXEL_MAP_I_TO_{R,G,B,A}
[Table 3.3]
void GetPixelMap{ui us f}v(enum map,
T data);
map: see PixelMap{ui us f}v
Color Table Specicaon [3.7.3]
void ColorTable(enum target,
enum internalformat, sizei width,
enum format, enum type,
const void *data);
target: {PROXY_}COLOR_TABLE,
{PROXY_}POST_CONVOLUTION_COLOR_TABLE,
{PROXY_}POST_COLOR_MATRIX_COLOR_TABLE
internalformat: T
he formats in [Table 3.16] or [Tables
3.17-3.19]
except RED, RG,
DEPTH_{COMPONENT, STENCIL} base and sized
internal formats in those tables, all sized internal
formats with non-xed internal data types as
discussed in
[3.9], and RGB9_E5.
format: RED, GREEN, BLUE, ALPHA, RG, RGB, RGBA,
BGRA, LUMINANCE, LUMINANCE_ALPHA
type: see DrawPixels
Enable/Disable(
POST_COLOR_MATRIX_COLOR_TABLE)
void ColorTableParameter{if}v(enum target,
enum pname, const T params);
target: COLOR_TABLE,
POST_COLOR_MATRIX_COLOR_TABLE,
POST_CONVOLUTION_COLOR_TABLE
pname: COLOR_TABLE_SCALE, COLOR_TABLE_BIAS
Alt. Color Table Specicaon Commands
void CopyColorTable(enum target,
enum internalformat, int x, int y,
sizei
width);
void ColorSubTable(enum target, sizei start,
sizei count, enum format, enum type,
void *data);
void CopyColorSubTable(enum target,
sizei start, int x, int y, sizei count);
target and pname: see ColorTableParameter{if}v
Color Table Query [6.1.8]
void GetColorTable(enum target,
enum format, enum type, void *table);
target: see ColorTableParameter{if}v
format: RED, GREEN, BLUE, ALPHA, RGB, RGBA,
BGR, BGRA, LUMINANCE{_ALPHA}
type: UNSIGNED_{BYTE, SHORT, INT}, BYTE,
SHORT, INT, UNSIGNED_BYTE_3_3_2,
UNSIGNED_BYTE_2_3_3_REV,
UNSIGNED_SHORT_5_6_5{_REV},
UNSIGNED_SHORT_4_4_4_4{_REV},
UNSIGNED_SHORT_5_5_5_1,
UNSIGNED_SHORT_1_5_5_5_REV,
UNSIGNED_INT_8_8_8_8{_REV},
UNSIGNED_INT_10_10_10_2,
UNSIGNED_
INT_2_10_10_10_REV
void GetColorTableParameter{if}v(
enum target, enum pname, T params);
target: see ColorTable
pname: COLOR_TABLE_x (where x may be SCALE,
BIAS, FORMAT, COLOR_TABLE_WIDTH, RED_SIZE,
GREEN_SIZE, BLUE_SIZE, ALPHA_SIZE,
LUMINANCE_SIZE, INTENSITY_SIZE)
Convoluon Filter Specicaon [3.7.3]
Enable/Disable(
POST_CONVOLUTION_COLOR_TABLE
)
void ConvoluonFilter2D(enum target,
enum internalformat, sizei width,
sizei height, enum format, enum type,
const void *data);
target: CONVOLUTION_2D
internalformat: see ColorTable
format: RED, GREEN, BLUE, ALPHA, RG, RGB, RGBA,
BGRA, LUMINANCE, LUMINANCE_ALPHA
type: BYTE, SHORT, INT, FLOAT, HALF_FLOAT,
UNSIGNED_{BYTE, SHORT, INT}
(Rasterizaon Connue >)
Shaders and Programs (cont.)
void GetAcveUniformsiv(uint program,
sizei uniformCount,
const uint
*uniformIndices,
enum pname,
int *params);
pname: UNIFORM_{TYPE, SIZE, NAME_LENGTH},
UNIFORM_BLOCK_INDEX, UNIFORM_OFFSET,
UNIFORM_{ARRAY, MATRIX}_STRIDE,
UNIFORM_IS_ROW_MAJOR
Load Uniform Vars. In Default Uniform Block
void Uniform{1234}{ifd}(int locaon,
T value);
void Uniform{1234}{ifd}v(int locaon,
sizei count, const T value);
void Uniform{1234}ui
(int locaon, T value);
void Uniform{1234}uiv(int locaon,
sizei count, const T value);
void UniformMatrix{234}{fd}v(
int locaon, sizei count,
boolean transpose, const T *value);
void UniformMatrix{2x3,3x2,2x4,4x2,
3x4,4x3}{fd}v(int locaon, sizei count,
boolean transpose, const T *value);
void ProgramUniform{1234}{ifd}(
uint program, int locaon, T value);
void ProgramUniform{1234}{ifd}v(
uint program, int locaon, sizei count,
const T value);
void ProgramUniform{1234}ui(
uint program, int locaon, T value);
void ProgramUniform{1234}uiv(
uint program, int locaon, sizei count,
const T value);
void ProgramUniformMatrix{234}{fd}v(
uint program, int locaon, sizei count,
boolean transpose, const oat *value);
void ProgramUniformMatrixf{2x3,3x2,2x4,
4x2,3x4,4x3}{fd}v
(
uint program, int locaon, sizei count,
boolean transpose, const oat *value);
Uniform Buer Object Bindings
void UniformBlockBinding(uint program,
uint uniformBlockIndex,
uint uniformBlockBinding);
Subroune Uniform Variables
[2.11.9] [2.14.9]
int GetSubrouneUniformLocaon(
uint program, enum shadertype,
const char *name);
uint GetSubrouneIndex(uint program,
enum shadertype, const char *name);
void GetAcveSubrouneUniformiv(
uint program, enum shadertype,
uint index, enum pname, int *values);
pname: {NUM_}COMPATIBLE_SUBROUTINES,
UNIFORM_SIZE, UNIFORM_NAME_LENGTH
void GetAcveSubrouneUniformName(
uint program, enum shadertype,
uint index, sizei bufsize, sizei *length,
char *name);
void GetAcveSubrouneName(
uint program, enum shadertype,
uint index, sizei bufsize, sizei *length,
char *name);
void UniformSubrounesuiv(enum shadertype,
sizei count, const uint *indices);
Varying Variables [2.11.12] [2.14.12]
void TransformFeedbackVaryings(
uint program, sizei count,
const char **varyings,
enum buerMode);
buerMode: {INTERLEAVED, SEPARATE}_ATTRIBS
void GetTransformFeedbackVarying(
uint program, uint index, sizei bufSize,
sizei *length, sizei *size, enum *type,
char *name);
*type returns NONE, FLOAT{_VECn}, DOUBLE{_VECn},
{UNSIGNED_}INT, {UNSIGNED_}INT_VECn, MATnxm,
{FLOAT, DOUBLE}_MATn, {FLOAT, DOUBLE}_MATnxm
Shader Execuon [2.11.13] [2.14.13]
void ValidateProgram(uint program);
void ValidateProgramPipeline(
uint pipeline);
Shader Memory Access
[2.11.14] [2.14.14]
void MemoryBarrier(biield barriers);
barriers: ALL_BARRIER_BITS or the OR of:
{VERTEX_ATTRIB_ARRAY, ELEMENT_ARRAY,
UNIFORM, TEXTURE_FETCH, BUFFER_UPDATE,
SHADER_IMAGE_ACCESS, COMMAND,
PIXEL_BUFFER, TEXTURE_UPDATE, FRAMEBUFFER,
TRANSFORM_FEEDBACK,
ATOMIC_COUNTER}_BARRIER_BIT
Tessellaon Control Shaders
[2.12.1-2] [2.15.1-2]
void PatchParameterfv(enum pname,
const oat *values);
pname: PATCH_DEFAULT_{INNER, OUTER}_LEVEL
Fragment Shaders [3.10.2] [3.13.2]
void BindFragDataLocaon(uint program,
uint colorNumber, const char *
name);
v
oid BindFragDataLocaonIndexed(
uint program, uint colorNumber,
uint index, const char *name);
int GetFragDataLocaon(uint program,
const char *name);
int GetFragDataIndex(uint program,
const char *name);
Shader and Program Queries
Shader Queries [6.1.12] [6.1.18]
boolean IsShader(uint shader);
void GetShaderiv(uint shader, enum pname,
int *params);
pname: SHADER_TYPE, {GEOMETRY, VERTEX}_SHADER,
TESS_{CONTROL,
EVALUATION}_SHADER,
FRAGMENT_SHADER, {DELETE, COMPILE}_STATUS,
INFO_LOG_LENGTH, SHADER_SOURCE_LENGTH
void GetShaderInfoLog(uint shader,
sizei bufSize, sizei *length, char *infoLog);
void GetShaderSource(uint shader,
sizei bufSize, sizei *length, char *source);
void GetShaderPrecisionFormat(
enum shadertype, enum precisiontype,
int *range, int *precision);
shadertype: {VERTEX, FRAGMENT}_SHADER
precisiontype: LOW_{FLOAT, INT},
MEDIUM_{FLOAT, INT}, HIGH_{FLOAT, INT}
void GetProgramStageiv(uint program, enum
shadertype, enum pname, int *values);
pname: ACTIVE_SUBROUTINES,
ACTIVE_SUBROUTINE_{UNIFORMS, MAX_LENGTH},
ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS,
ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH
Program Queries [6.1.12] [6.1.18]
void GetAachedShaders(uint program, sizei
maxCount, sizei *count, uint *shaders);
void GetVertexArib{d f i}v(uint index,
enum pname, T *params);
pname: CURRENT_VERTEX_ATTRIB or
VERTEX_ATTRIB_ARRAY_x where x is one of
BUFFER_BINDING, DIVISOR, ENABLED, INTEGER,
NORMALIZED, SIZE, STRIDE, or TYPE
void GetVertexAribl{i ui}v(uint index,
enum pname, T *params);
pname: see GetVertexArib{d f i}v
void GetVertexAribLdv(uint index,
enum pname, double *params);
pname: see GetVertexArib{d f i}v
void GetVertexAribPointerv(uint index,
enum pname, void **pointer);
pname: VERTEX_ATTRIB_ARRAY_POINTER
void GetUniform{f d i ui}v(uint program,
int locaon, T *params);
void GetUniformSubrouneuiv(
enum shadertype, int locaon,
uint *params);
boolean IsProgram(uint program);
void GetProgramiv(uint program,
enum pname, int *params);
pname:
DELETE_STATUS, LINK_STATUS,
VALIDATE_STATUS, INFO_LOG_LENGTH,
ATTACHED_SHADERS, ACTIVE_ATTRIBUTES,
ACTIVE_ UNIFORMS{_BLOCKS},
ACTIVE_ATTRIBUTES_MAX_LENGTH,
ACTIVE_UNIFORM_MAX_LENGTH,
TRANSFORM_FEEDBACK_BUFFER_MODE,
TRANSFORM_FEEDBACK_ VARYINGS,
TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH,
ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH,
GEOMETRY_VERTICES_OUT,
GEOMETRY_{INPUT, OUTPUT}_TYPE,
GEOMETRY_SHADER_INVOCATIONS,
TESS_CONTROL_OUTPUT_VERTICES,
TESS_GEN_{MODE, SPACING, VERTEX_ORDER},
TESS_GEN_POINT_MODE, PROGRAM_SEPARABLE,
PROGRAM_BINARY_{LENGTH, RETRIEVABLE_HINT}
boolean IsProgramPipeline(uint pipeline);
void GetProgramPipelineiv(uint pipeline,
enum pname, int *params);
void GetProgramInfoLog(uint program,
sizei bufSize, sizei *length, char *infoLog);
void GetProgramPipelineInfoLog(
uint pipeline, sizei bufSize,
sizei *length, char *infoLog);