没有合适的资源?快使用搜索试试~ 我知道了~
OpenGL4.3快速查阅卡
5星 · 超过95%的资源 需积分: 13 42 下载量 141 浏览量
2012-10-16
20:32:12
上传
评论
收藏 4.19MB PDF 举报
温馨提示
试读
12页
这是OpenGL官方绘制的一张OpenGL4.3版本的快速查阅卡片,上面以非常简洁的分类方式绘制了OpenGL的所有函数的声明,还有OpenGL4.3的一些框架图,非常实用,对于研究图形的人来说,把这个卡片作为海报贴在墙上也不为过,呵呵
资源推荐
资源详情
资源评论
www.opengl.org/registry ©2012 Khronos Group - Rev. 0812
OpenGL 4.3 API Reference Card Page 1
OpenGL Operaon
Floang-Point Numbers [2.3.3]
16-Bit 1-bit sign, 5-bit exponent,
10-bit manssa
Unsigned 11-Bit no sign bit, 5-bit exponent,
6-bit manssa
Unsigned 10-Bit no sign bit, 5-bit exponent,
5-bit manssa
Command Leers [Table 2.2]
Leers are used in commands to denote types.
b - byte (8 bits) ub - ubyte (8 bits)
s - short (16 bits) us - ushort (16 bits)
i - int (32 bits) ui - uint (32 bits)
i64 - int64 (64 bits) ui64 - uint64 (64 bits)
f - oat (32 bits) d - double (64 bits)
OpenGL
®
is the only cross-plaorm graphics API that enables developers of
soware for PC, workstaon, and supercompung hardware to create high-
performance, visually-compelling graphics soware applicaons, in markets
such as CAD, content creaon, energy, entertainment, game development,
manufacturing, medical, and virtual reality. Specicaons are available at
www.opengl.org/registry
• see FunconName refers to funcons on this reference card.
• [n.n.n] and [Table n.n] refer to secons and tables in the OpenGL 4.3 core specicaon.
• [n.n.n] refers to secons in the OpenGL Shading Language 4.30 specicaon.
OpenGL Command Syntax [2.2]
GL commands are formed from a return type, a name, and oponally up to 4 characters
(or character pairs) from the Command Leers table (to the le), as shown by the prototype:
return-type Name{1234}{b s i i64 f d ub us ui ui64}{v} ([args ,] T arg1 , . . . , T argN [, args]);
The arguments enclosed in brackets ([args ,] and [, args]) may or may not be present.
The argument type T and the number N of arguments may be indicated by the command name
suxes. N is 1, 2, 3, or 4 if present. If “v” is present, an array of N items is passed by a pointer.
For brevity, the OpenGL documentaon and this reference may omit the standard prexes.
The actual names are of the forms:
glFunconName(), GL_CONSTANT, GLtype
Buer Objects
[6]
void GenBuers(sizei n, uint *buers);
void DeleteBuers
(sizei n, const uint *buers);
Creang and Binding Buer Objects[6.1]
void BindBuer(enum target, uint buer);
target:
PIXEL_{PACK, UNPACK}_BUFFER,
{UNIFORM, ARRAY, TEXTURE}_BUFFER,
COPY_{READ, WRITE}_BUFFER,
{DISPATCH, DRAW}_INDIRECT_BUFFER,
{ATOMIC_COUNTER, ELEMENT_ARRAY}_BUFFER,
{SHADER_STORAGE ,TRANSFORM_FEEDBACK}_BUFFER
void BindBuerRange(
enum target, uint index,
uint buer, intptr oset, sizeiptr size);
target: ATOMIC_COUNTER_BUFFER,
{
SHADER_STORAGE, UNIFORM}_BUFFER,
TRANSFORM_FEEDBACK_BUFFER
void BindBuerBase(enum target,
uint index, uint buer);
target: see BindBuerRange
Creang/Clearing Buer Object Data [6.2]
void BuerSubData(enum target,
intptr oset, sizeiptr size,
const void *data);
target: see BindBuer
void BuerData(enum target, sizeiptr size,
const void *data, enum usage);
target: see BindBuer
usage: STREAM_{DRAW, READ, COPY},
{DYNAMIC, STATIC}_{DRAW, READ, COPY}
void ClearBuerSubData(enum target,
enum internalFormat, intptr oset,
sizeiptr size, enum format, enum type,
const void *data);
target: see BindBuer
internalformat: see TexBuer on pg. 2 of this card
format: RED, GREEN, BLUE, RG, RGB, RGBA, BGR,
BGRA
,{RED, GREEN, BLUE, RG, RGB}_INTEGER,
{RGBA, BGR, BGRA} _INTEGER, STENCIL_INDEX,
DEPTH_{COMPONENT, STENCIL}
void ClearBuerData(enum target,
enum internalformat, enum format,
enum type, const void *data);
target, internalformat, format: see ClearBuerSubData
Mapping/Unmapping Buer Data[6.3]
void *MapBuerRange(enum target,
intptr oset, sizeiptr length,
biield access);
access: The logical OR of MAP_{READ, WRITE}_BIT,
MAP_INVALIDATE_{BUFFER, RANGE}_BIT,
MAP_{FLUSH_EXPLICIT, UNSYNCHRONIZED}_BIT
target: see BindBuer
void *MapBuer(enum target, enum access);
access: READ_ONLY, WRITE_ONLY, READ_WRITE
void FlushMappedBuerRange(
enum target, intptr oset,
sizeiptr length);
target: see BindBuer
boolean UnmapBuer(enum target);
target: see BindBuer
Invalidate Buer Data [6.5]
void InvalidateBuerSubData(uint buer,
intptr oset, sizeiptr length);
void InvalidateBuerData(uint buer);
Copying Between Buers [6.6]
void CopyBuerSubData(enum readtarget,
enum writetarget, intptr readoset,
intptr writeoset, sizeiptr size);
readtarget and writetarget: see BindBuer
Buer Object Queries [6, 6.7]
boolean IsBuer(uint buer);
void GetBuerParameteriv(enum target,
enum pname, int *data);
target: see BindBuer
pname: BUFFER_SIZE, BUFFER_USAGE,
BUFFER_ACCESS{_FLAGS}, BUFFER_MAPPED,
BUFFER_MAP_{OFFSET, LENGTH}
void GetBuerParameteri64v(enum target,
enum pname, int64 *data);
target: see BindBuer
pname: see GetBuerParameteriv,
void GetBuerSubData(enum target,
intptr oset, sizeiptr size, void *data);
target: see BindBuer
void GetBuerPointerv(enum target,
enum pname, void **params);
target: see BindBuer
pname: BUFFER_MAP_POINTER
OpenGL Errors
[2.3.1]
enum GetError(void); Returns the numeric error code.
Shaders and Programs
Shader Objects [7.1-2]
uint CreateShader(enum type);
type:
TESS_{EVALUATION, CONTROL}_SHADER,
{COMPUTE, FRAGMENT, GEOMETRY, VERTEX}_SHADER
void ShaderSource(uint shader, sizei count,
const char * const * string,
const int *length);
void CompileShader(uint shader);
void ReleaseShaderCompiler(void);
void DeleteShader(uint shader);
boolean IsShader(uint shader);
void ShaderBinary(sizei count,
const uint *shaders, enum binaryformat,
const void *binary, sizei length);
Program Objects [7.3]
uint CreateProgram(void);
void AachShader
(uint program, uint shader);
void DetachShader(uint program,
uint shader);
void LinkProgram(uint program);
void UseProgram(uint program);
uint CreateShaderProgramv(enum type,
sizei count, const char * const * strings);
void ProgramParameteri(uint program,
enum pname, int value);
pname: PROGRAM_SEPARABLE,
PROGRAM_BINARY_RETRIEVABLE_HINT
value: TRUE, FALSE
void DeleteProgram(uint program);
boolean IsProgram(uint program);
Program Interfaces [7.3.1]
void GetProgramInterfaceiv(uint program,
enum programInterface, enum pname,
int *params);
programInterface: UNIFORM{_BLOCK},
PROGRAM_{INPUT, OUTPUT}, BUFFER_VARIABLE,
SHADER_STORAGE_BLOCK,
ATOMIC_COUNTER_BUFFER,
{GEOMETRY, VERTEX}_SUBROUTINE,
TESS_{CONTROL, EVALUATION}_SUBROUTINE,
{FRAGMENT, COMPUTE}_SUBROUTINE,
TESS_{CONTROL, EVALUATION}_SUBROUTINE_UNIFORM,
{GEOMETRY, VERTEX}_SUBROUTINE_UNIFORM,
{FRAGMENT, COMPUTE}_SUBROUTINE_UNIFORM,
TRANSFORM_FEEDBACK_VARYING
pname: ACTIVE_RESOURCES, MAX_NAME_LENGTH,
MAX_NUM_ACTIVE_VARIABLES,
MAX_NUM_COMPATIBLE_SUBROUTINES
uint GetProgramResourceIndex(
uint program, enum programInterface,
const char *name);
void GetProgramResourceName(
uint program, enum programInterface,
uint index, sizei bufSize, sizei *length,
char *name);
void GetProgramResourceiv(uint program,
enum programInterface, uint index,
sizei propCount, const enum *props,
sizei bufSize, sizei *length, int *params);
*props: [see Table 7.2]
int GetProgramResourceLocaon(
uint program, enum programInterface,
const char *name);
int GetProgramResourceLocaonIndex(
uint program, enum programInterface,
const char *name);
Program Pipeline Objects
[7.4]
void GenProgramPipelines(sizei n,
uint *pipelines);
void DeleteProgramPipelines(sizei n,
const uint *pipelines);
void BindProgramPipeline(uint pipeline);
void UseProgramStages(uint pipeline,
biield stages, uint program);
stages: ALL_SHADER_BITS or the bitwise OR of
TESS_{CONTROL, EVALUATION}_SHADER_BIT,
{VERTEX, GEOMETRY, FRAGMENT}_SHADER_BIT,
COMPUTE_SHADER_BIT
void AcveShaderProgram(uint pipeline,
uint program);
Program Binaries [7.5]
void GetProgramBinary(uint program,
sizei bufSize, sizei *length,
enum *binaryFormat, void *binary);
void ProgramBinary(uint program,
enum binaryFormat, const void *binary,
sizei length);
Uniform Variables [7.6]
int GetUniformLocaon(uint program,
const char *name);
void GetAcveUniformName(uint program,
uint uniformIndex, sizei bufSize,
sizei *length, char *uniformName);
void GetUniformIndices(uint program,
sizei uniformCount, const char **uniformNames,
uint *uniformIndices);
(Connued on next page >)
Synchronizaon
Flush and Finish [2.3.2]
void Flush(void);
void Finish(void);
Sync Objects and Fences [4.1]
void DeleteSync(sync sync);
sync FenceSync(enum condion,
biield ags);
condion: SYNC_GPU_COMMANDS_COMPLETE
ags: must be 0
Waing for Sync Objects [4.1.1]
enum ClientWaitSync(sync sync,
biield ags, uint64 meout_ns);
ags: SYNC_FLUSH_COMMANDS_BIT, or zero
void WaitSync(sync sync, biield ags,
uint64 meout);
meout: TIMEOUT_IGNORED
Sync Object Queries [4.1.3]
void GetSynciv(sync sync, enum pname,
sizei bufSize, sizei *length, int *values);
pname:
OBJECT_TYPE, SYNC_{STATUS, CONDITION, FLAGS}
boolean IsSync(sync sync);
Timer Queries
[4.3]
Timer queries use query objects to track the
amount of me needed to fully complete a set
of GL commands.
void QueryCounter(uint id, TIMESTAMP);
void GetInteger64v(TIMESTAMP, int64 *data);
Asynchronous Queries
[4.2, 4.2.1]
void GenQueries(sizei n, uint *ids);
void DeleteQueries(sizei n, const uint *ids);
void BeginQuery(enum target, uint id);
target:
PRIMITIVES_GENERATED{n},
{ANY_}SAMPLES_PASSED{CONSERVATIVE},
TIME_ELAPSED,
TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN{n}
void BeginQueryIndexed(enum target,
uint index, uint id);
void EndQuery(enum target);
void EndQueryIndexed(enum target,
uint index);
void GetQueryiv(enum target, enum pname,
int *params);
(parameters
)
target: see BeginQuery, plus TIMESTAMP
pname: CURRENT_QUERY, QUERY_COUNTER_BITS
boolean IsQuery(uint id);
void GetQueryIndexediv(enum target,
uint index, enum pname, int *params);
target: see BeginQuery
pname: CURRENT_QUERY, QUERY_COUNTER_BITS
void GetQueryObjecv(uint id,
enum pname, int *params);
void GetQueryObjectuiv(uint id,
enum pname, uint *params);
void GetQueryObjec64v(uint id,
enum pname, int64 *params);
void GetQueryObjectui64v(uint id,
enum pname, uint64 *params);
pname: QUERY_RESULT{_AVAILABLE}
www.opengl.org/registry
©2012 Khronos Group - Rev. 0812
Page 2 OpenGL 4.3 API Reference Card
Shaders and Programs (cont.)
void GetAcveUniform(uint program,
uint index, sizei bufSize, sizei *length,
int *size, enum *type, char *name);
*type returns: DOUBLE_{VECn, MATn, MATnxn},
DOUBLE, FLOAT_{VECn, MATn, MATnxn}, FLOAT,
INT, INT_VECn, UNSIGNED_INT{_VECn}, BOOL,
BOOL_VECn, or any value in [Table 7.3]
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,
UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX
uint GetUniformBlockIndex(uint program,
const char *uniformBlockName);
void GetAcveUniformBlockName(
uint program, uint uniformBlockIndex,
sizei bufSize, sizei length,
char *uniformBlockName);
void GetAcveUniformBlockiv(
uint program, uint uniformBlockIndex,
enum pname, int *params);
pname: UNIFORM_BLOCK_{BINDING, DATA_SIZE},
UNIFORM_BLOCK_NAME_LENGTH,
UNIFORM_BLOCK_ACTIVE_UNIFORMS{_INDICES},
UNIFORM_BLOCK_REFERENCED_BY_x_SHADER,
where x may be one of VERTEX,
FRAGMENT,
COMPUTE,
GEOMETRY,
TESS_CONTROL, or
TESS_EVALUATION
void GetAcveAtomicCounterBueriv(
uint program, uint buerIndex,
enum pname, int *params);
pname: see GetAcveUniformBlockiv
Load Uniform Vars. In Default Uniform Block
void Uniform{1234}{i f d}(int locaon, T value);
void Uniform{1234}{i f d}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}{f d}v(
int locaon, sizei count, boolean transpose,
const oat *value);
void UniformMatrix{2x3,3x2,2x4,4x2,3x4,
4x3}{fd}v(int locaon, sizei count,
boolean transpose, const oat *value);
void ProgramUniform{1234}{i f d}(
uint program, int locaon, T value);
void ProgramUniform{1234}{i f d}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}{f d}v(
uint program, int locaon, sizei count,
boolean transpose, const oat *value);
void ProgramUniformMatrixf{2x3,3x2,2x4,4x2,
3x4, 4x3}{f d}v
(
uint program, int locaon, sizei count,
boolean transpose, const oat *value);
Uniform Buer Object Bindings
void UniformBlockBinding(uint program,
uint uniformBlockIndex,
uint uniformBlockBinding);
Shader Buer Variables [7.7]
void ShaderStorageBlockBinding(
uint program, uint storageBlockIndex,
uint storageBlockBinding);
Subroune Uniform Variables [7.8]
Parameter
shadertype
for the funcons in this
secon may be one of
TESS_{CONTROL, EVALUATION}_SHADER,
{COMPUTE, VERTEX, FRAGMENT, GEOMETRY}_SHADER
int GetSubrouneUniformLocaon(
uint program, enum shadertype,
const char *name);
uint GetSubrouneIndex(uint program,
enum shadertype, const char *name);
void GetAcveSubrouneName(
uint program, enum shadertype,
uint index, sizei bufsize, sizei *length,
char *name
);
void GetAcveSubrouneUniformName(
uint program, enum shadertype,
uint index, sizei bufsize, sizei *length,
char *name);
void GetAcveSubrouneUniformiv(
uint program, enum shadertype,
uint index, enum pname, int *values);
pname: {NUM_}COMPATIBLE_SUBROUTINES
void UniformSubrounesuiv(enum shadertype,
sizei count, const uint *indices);
Shader Memory Access
[7.11.2]
See diagram on page 11 for more informaon.
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,
SHADER_STORAGE}_BARRIER_BIT
Shader|Program Queries [7.12]
void GetShaderiv(uint shader, enum pname,
int *params);
pname: SHADER_TYPE, FRAGMENT_SHADER,
{GEOMETRY, VERTEX}_SHADER, TESS_{CONTROL,
EVALUATION}_SHADER, INFO_LOG_LENGTH,
{DELETE, COMPILE}_STATUS, COMPUTE_SHADER,
SHADER_SOURCE_LENGTH
void GetProgramiv(uint program,
enum pname, int *params);
pname: {
DELETE, LINK, VALIDATE}_STATUS,
INFO_LOG_LENGTH, ATTACHED_SHADERS,
ACTIVE_{UNIFORMS, ATTRIBUTES},
ACTIVE_ATTRIBUTE_MAX_LENGTH,
ACTIVE_UNIFORM_{BLOCKS, MAX_LENGTH},
ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH,
ACTIVE_ATOMIC_COUNTER_BUFFERS,
TRANSFORM_FEEDBACK_{BUFFER_MODE, VARYINGS},
TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH,
GEOMETRY_{INPUT, OUTPUT}_TYPE,
COMPUTE_WORK_GROUP_SIZE,
GEOMETRY_{SHADER_INVOCATIONS, VERTICES_OUT}
Texturing [8]
void AcveTexture(enum texture);
texture: TEXTUREi (where i is
[0, max(MAX_TEXTURE_COORDS,
MAX_COMBINED_TEXTURE_IMAGE_UNITS)-1])
Texture Objects [8.1]
void GenTextures(sizei n, uint *textures);
void BindTexture(enum target, uint texture);
target: TEXTURE_{1D, 2D}{_ARRAY},
TEXTURE_{3D, RECTANGLE, BUFFER},
TEXTURE_CUBE_MAP{_ARRAY},
TEXTURE_2D_MULTISAMPLE{_ARRAY}
void DeleteTextures(sizei n,
const uint *textures);
boolean IsTexture(uint texture);
Sampler Objects [8.2]
void GenSamplers(sizei count, uint *samplers);
void BindSampler(uint unit, uint sampler);
void SamplerParameter{i f}(uint sampler,
enum pname, T param);
pname: TEXTURE_x where x may be WRAP_{S, T, R},
{MIN, MAG}_FILTER, {MIN, MAX}_LOD,
BORDER_COLOR, LOD_BIAS, COMPARE_{MODE, FUNC}
void SamplerParameter{i f}v(uint sampler,
enum pname, const T *param);
pname:
see SamplerParameter{if}
void SamplerParameter
I
{i ui}v(uint sampler,
enum pname, const T *params);
pname:
see SamplerParameter{if}
void DeleteSamplers(sizei count,
const uint *samplers);
boolean IsSampler(uint sampler);
Sampler Queries [8.3]
void GetSamplerParameter{i f}v(
uint sampler, enum pname, T *params);
pname:
see SamplerParameter{if}
void GetSamplerParameterI{i ui}v(
uint sampler, enum pname, T *params);
pname:
see SamplerParameter{if}
Texture Image Spec. [8.5]
void TexImage1D(enum target, int level,
int internalformat, sizei width, int border,
enum format, enum type, const void *data);
target: TEXTURE_1D, PROXY_TEXTURE_1D
type, internalformat, format: see TexImage3D
void TexImage2D(enum target, int level,
int internalformat, sizei width,
sizei height, int border, enum format,
enum type, const void *data);
target: PROXY_TEXTURE_CUBE_MAP,
POSITIVE_{X, Y, Z}, NEGATIVE_{X, Y, Z}
internalformat, format, type: see TexImage3D
void TexImage3D
(enum target, int level,
int internalformat, sizei width, sizei height,
sizei depth, int border, enum format,
enum type, const void *data);
target: TEXTURE_{3D, 2D_ARRAY, CUBE_MAP_ARRAY},
PROXY_TEXTURE_{3D, 2D_ARRAY, CUBE_MAP_ARRAY}
internalformat: DEPTH_{COMPONENT, STENCIL}, RED,
INTENSITY, RG, RGB, RGBA; or a sized internal format
from
[Tables 8.12 - 8.13], COMPRESSED_{RED_RGTC1},
COMPRESSED_ {RG_RGTC2},
COMPRESSED_SIGNED_{RED_RGTC1, RG_RGTC2},
or a specic compressed format in
[Table 8.14]
format:
DEPTH_{COMPONENT, STENCIL}, RED, GREEN,
BLUE, RG, RGB, RGBA, BGR, BGRA, BGRA_INTEGER,
{RED, GREEN, BLUE
}_INTEGER, {RG, RGB}_INTEGER,
{RGBA, BGR}_INTEGER [Table 8.3]
type: {UNSIGNED_}{BYTE, SHORT, INT}, HALF_FLOAT,
FLOAT, or a value from [Table 8.2]
Alternate Texture Image Spec. [8.6]
void CopyTexImage1D(enum target,
int level, enum internalformat, int x,
int y, sizei width, int border);
target: TEXTURE_1D
internalformat: see TexImage3D
void CopyTexImage2D(enum target,
int level, enum internalformat, int x,
int y, sizei width, sizei height, int border);
target: TEXTURE_{2D, RECTANGLE, 1D_ARRAY},
TEXTURE_CUBE_MAP_{POSITIVE, NEGATIVE}_{X, Y, Z}
internalformat: see TexImage3D
void TexSubImage1D(enum target, int level,
int xoset, sizei width, enum format,
enum type, const void *data);
target: TEXTURE_1D
format, type: see TexImage1D
void TexSubImage2D(enum target, int level,
int xoset, int yoset, sizei width,
sizei height, enum format, enum type,
const void *data);
target: see CopyTexImage2D
format, type: see TexImage3D
void TexSubImage3D(
enum target, int level,
int xoset, int yoset, int zoset,
sizei width, sizei height, sizei depth,
enum format, enum type, const void *data);
target: TEXTURE_3D, TEXTURE_2D_ARRAY,
TEXTURE_CUBE_MAP_ARRAY
format, type: see TexImage3D
void CopyTexSubImage1D(enum target,
int level, int xoset, int x, int y, sizei width);
target: see TexSubImage1D
void CopyTexSubImage2D(enum target,
int level, int xoset, int yoset, int x,
int y, sizei width, sizei height);
target: see TexSubImage2D
void CopyTexSubImage3D(enum target,
int level, int xoset, int yoset, int zoset,
int x, int y, sizei width, sizei height);
target: see TexSubImage3D
Compressed Texture Images [8.7]
void CompressedTexImage1D(enum target,
int level, enum internalformat,
sizei width, int border, sizei imageSize,
const void *data);
target: TEXTURE_1D, PROXY_TEXTURE_1D
internalformat:
values are implementaon-dependent
void CompressedTexImage2D(enum target,
int level, enum internalformat,
sizei width, sizei height, int border,
sizei imageSize, const void *data);
target: see TexImage2D, oming compressed
rectangular texture formats
internalformat: see CompressedTexImage3D,
plus COMPRESSED_x where x may be
{RGB8, SRGB8}_ETC2,
{RGB8, SRGB8}_PUNCHTHROUGH_ALPHA1_ETC2
void CompressedTexImage3D(enum target,
int level, enum internalformat, sizei width,
sizei height, sizei depth, int border,
sizei imageSize, const void *data);
target: see TexImage3D
internalformat: COMPRESSED_x where x may be
{SIGNED_}RED_RGTC1, {SIGNED_}RG_RGTC2,
{RGBA, SRGB_ALPHA}_BPTC_UNORM,
RGB_BPTC_{SIGNED, UNSIGNED}_FLOAT
void CompressedTexSubImage1D(
enum target, int level, int xoset,
sizei width, enum format, sizei imageSize,
const void *data);
target: see TexSubImage1D
format: see TexImage1D
void CompressedTexSubImage2D(
enum target, int level, int xoset,
int yoset, sizei width, sizei height,
enum format, sizei imageSize,
cont void *data);
target: see TexSubImage2D
format: see TexImage2D
void CompressedTexSubImage3D(
enum target, int level, int xoset,
int yoset,
int zoset, sizei width,
sizei height, sizei depth, enum format,
sizei imageSize, const void *data);
target: see TexSubImage3D
format:
see internalformat for CompressedTexImage3D
Mulsample Textures [8.8]
void TexImage2DMulsample(enum target,
sizei samples, int internalformat,
sizei width, sizei height,
boolean xedsamplelocaons);
target: {PROXY_}TEXTURE_2D_MULTISAMPLE
internalformat: see TexImage3DMulsample
void TexImage3DMulsample(enum target,
sizei samples
, int internalformat,
sizei width, sizei height, sizei depth,
boolean xedsamplelocaons);
target: {PROXY_}TEXTURE_2D_MULTISAMPLE_ARRAY
internalformat: RED, RG, RGB, RGBA, STENCIL_INDEX,
DEPTH_{COMPONENT, STENCIL}, or sized internal
formats corresponding to these base formats
Buer Textures [8.9]
void TexBuerRange(enum target,
enum internalFormat, uint buer,
intptr oset, sizeiptr size);
void TexBuer(enum target,
enum internalformat, uint buer);
target: TEXTURE_BUFFER
internalformat: R8{I,UI}, R16{F, I, UI}, R32{F, I, UI},
RG8{I, UI}, RG16{F, I, UI}, RG32{F, I, UI},
RGB32{F, I, UI}, RGBA8{I, UI}, RGBA16{F, I, UI},
RGBA32{F, I, UI}
(Connued on next page >)
www.opengl.org/registry ©2012 Khronos Group - Rev. 0812
OpenGL 4.3 API Reference Card Page 3
Framebuer Objects
Binding and Managing [9.2]
void BindFramebuer(enum target,
uint framebuer);
target: {DRAW, READ_}FRAMEBUFFER
void GenFramebuers(sizei n, uint *ids);
void DeleteFramebuers(sizei n,
const uint *framebuers);
boolean IsFramebuer(uint framebuer);
Framebuer Object Parameters [9.2.1]
void FramebuerParameteri(
enum target, enum pname, int param);
target: {DRAW_, READ_}FRAMEBUFFER
pname:
FRAMEBUFFER_DEFAULT_x where x may be
WIDTH, HEIGHT, FIXED_SAMPLE_LOCATIONS,
SAMPLES, LAYERS
Framebuer Object Queries [9.2.3]
void GetFramebuerParameteriv(
enum target, enum pname, int *params);
target: {DRAW_, READ_}FRAMEBUFFER
pname: see FramebuerParameteri
void GetFramebuerAachmentParameteriv(
enum target, enum aachment,
enum pname, int *params);
target: {DRAW_, READ_}FRAMEBUFFER
aachment: DEPTH, FRONT_{LEFT, RIGHT}, STENCIL,
BACK_{LEFT, RIGHT}, COLOR_ATTACHMENTi,
{DEPTH, STENCIL, DEPTH_STENCIL}_ATTACHMENT
pname: FRAMEBUFFER_ATTACHMENT_x where x may
be OBJECT_{TYPE, NAME}, COMPONENT_TYPE,
{RED, GREEN, BLUE, ALPHA, DEPTH, STENCIL}_SIZE,
COLOR_ENCODING, TEXTURE_LEVEL, LAYERED,
TEXTURE_CUBE_MAP_FACE, TEXTURE_LAYER
Aaching Images [9.2.4]
void BindRenderbuer(enum target,
uint renderbuer);
target: RENDERBUFFER
void GenRenderbuers(sizei n,
uint *renderbuers);
void DeleteRenderbuers(sizei n,
const uint *renderbuers);
boolean IsRenderbuer(uint renderbuer);
void RenderbuerStorageMulsample(
enum target, sizei samples,
enum internalformat, sizei width,
sizei height);
target: RENDERBUFFER
internalformat: see TexImage3DMulsample
void RenderbuerStorage(enum target,
enum internalformat, sizei width,
sizei height);
target: RENDERBUFFER
internalformat: see TexImage3DMulsample
Renderbuer Object Queries [9.2.6]
void GetRenderbuerParameteriv(
enum target, enum pname, int *params);
target: RENDERBUFFER
pname: RENDERBUFFER_x where x may be
(WIDTH, HEIGHT, INTERNAL_FORMAT, SAMPLES,
{RED, GREEN, BLUE, ALPHA, DEPTH, STENCIL}_SIZE)
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);
pname: ACTIVE_PROGRAM, VALIDATE_STATUS,
{VERTEX, FRAGMENT, GEOMETRY}_SHADER,
TESS_{CONTROL, EVALUATION}_SHADER,
INFO_LOG_LENGTH, COMPUTE_SHADER
void GetAachedShaders(uint program,
sizei maxCount, sizei *count, uint *shaders);
void GetShaderInfoLog(uint shader,
sizei bufSize, sizei *length, char *infoLog);
void GetProgramInfoLog(uint program,
sizei bufSize, sizei *length, char *infoLog);
void GetProgramPipelineInfoLog(
uint pipeline, 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, MEDIUM, HGH}_{FLOAT, INT}
void GetUniform{f d i ui}v(uint program,
int locaon, T *params);
void GetUniformSubrouneuiv(
enum shadertype, int locaon,
uint *params);
void GetProgramStageiv(uint program,
enum shadertype, enum pname,
int *values);
pname:
ACTIVE_SUBROUTINES_x where x may be
UNIFORMS, MAX_LENGTH, UNIFORM_LOCATIONS,
UNIFORM_MAX_LENGTH
Aaching Renderbuer Images [9.2.7]
void FramebuerRenderbuer(enum target,
enum aachment, enum renderbuertarget,
uint renderbuer);
target: {DRAW, READ_}FRAMEBUFFER
aachment: {DEPTH, STENCIL}_ATTACHMENT,
DEPTH_STENCIL_ATTACHMENT,
COLOR_ATTACHMENTi (where i is
[0, MAX_COLOR_ATTACHMENTS - 1])
renderbuertarget: RENDERBUFFER
Aaching Texture Images [9.2.8]
void FramebuerTexture(enum target,
enum aachment, uint texture, int level);
target: {DRAW, READ_}FRAMEBUFFER
aachment: see FramebuerRenderbuer
void FramebuerTexture1D(enum target,
enum aachment, enum textarget,
uint texture, int level);
textarget: TEXTURE_1D
target, aachment: see FramebuerRenderbuer
void FramebuerTexture2D(enum target,
enum aachment, enum textarget,
uint texture, int level);
textarget:
TEXTURE_CUBE_MAP_POSITIVE_{X, Y, Z}
,
TEXTURE_CUBE_MAP_NEGATIVE_{X, Y, Z},
TEXTURE_{2D, RECTANGLE, 2D_MULTISAMPLE}
target, aachment: see FramebuerRenderbuer
void FramebuerTexture3D(enum target,
enum aachment, enum textarget,
uint texture, int level, int layer);
textarget: TEXTURE_3D
target, aachment: see FramebuerRenderbuer
void FramebuerTextureLayer(enum target,
enum aachment, uint texture,
int level, int layer);
target, aachment: see
FramebuerRenderbuer
Framebuer Completeness [9.4.2]
enum CheckFramebuerStatus(enum target);
target: {DRAW_, READ_}FRAMEBUFFER
returns: FRAMEBUFFER_COMPLETE or a constant
indicang the violang value
Texturing (cont.)
Texture Parameters [8.10]
void TexParameter{i f}(enum target,
enum pname, T param);
target: see BindTexture
void TexParameter{i f}v(enum target,
enum pname, const T *params);
target: see BindTexture, plus
TEXTURE_{BORDER_COLOR, SWIZZLE_RGBA}
void TexParameterI{i ui}v(enum target,
enum pname, const T *params);
target: see BindTexture, plus
TEXTURE_{BORDER_COLOR, SWIZZLE_RGBA}
pname: DEPTH_STENCIL_TEXTURE_MODE or
TEXTURE_x where x may be one of
WRAP_{S, T, R}, BORDER_COLOR,
{MIN, MAG}_FILTER,
LOD_BIAS,{MIN, MAX}_LOD, {BASE, MAX}_LEVEL,
SWIZZLE_{R, G, B, A, RGBA}, COMPARE_{MODE, FUNC}
[Table 8.16]
Enumerated Queries [8.11]
void GetTexParameter{if}v(enum target,
enum value, T data);
target: see BindTexture
value: see pname for TexParameter
void GetTexParameterI{i ui}v(enum target,
enum value, T data);
target: TEXTURE_{1D, 2D, 3D, RECTANGLE},
TEXTURE_{1D, 2D}_ARRAY,
TEXTURE_CUBE_MAP{_ARRAY}
value: see pname for
TexParameterI{i ui}v,
plus
IMAGE_FORMAT_COMPATIBILITY_TYPE,
TEXTURE_IMMUTABLE_{FORMAT, LEVELS},
TEXTURE_VIEW_NUM_{LEVELS, LAYERS},
TEXTURE_VIEW_MIN_{LEVEL, LAYER},
[Table 8.16]
void GetTexLevelParameter{i f}v(enum target,
int lod, enum value, T data);
target: {PROXY_}TEXT
URE_{1D, 2D, 3D},
TEXTURE_BUFFER,
PROXY_TEXTURE_CUBE_MAP,
{PROXY_}TEXTURE_{1D, 2D,CUBE_MAP}_ARRAY,
{PROXY_}TEXTURE_RECTAN
GLE,
TEXTURE_CUBE_MAP_{POSITIVE,
NEGATIVE}_{X, Y, Z},
{PROXY_}TEXTURE_2D_MULTISAMPLE{_ARRAY}
value: TEXTURE_{WID
TH, HEIGHT, DEPTH},
TEXTURE_{SAMPLES, FIXED_SAMPLE_LOCATIONS},
TEXTURE_{INTERNAL_FORMAT, SHARED_SIZE},
TEXTURE_COMPRESSED{_IMAGE_SIZE},
TEXTURE_BUFFER_DATA_STORE_BINDING,
TEXTURE_BUFFER_{OFFSET, SIZE},
TEXTURE_STENCIL_SIZE, TEXTURE_x_{SIZE, TYPE}
(where x can be RED, GREEN, BLUE, ALPHA, DEPTH)
void GetTexImage(enum tex, int lod,
enum format, enum type, void *img);
tex: TEXTURE_{1, 2}D{_ARRAY},
TEXTURE_{3D,
RECTANGLE, CUBE_MAP_ARRAY},
TEXTURE_CUBE_MAP_{POSITIVE, NEGATIVE}_{X, Y, Z}
format:
see ClearBuerSubData, pg 1 this card
type:
{UNSIGNED_}BYTE, SHORT, INT,
{HALF_}FLOAT, or value from
[Table 8.2]
void GetCompressedTexImage(enum target,
int lod, void *img);
target: see tex for GetTexImage
Cube Map Texture Select [8.13.1]
Enable/Disable(
TEXTURE_CUBE_MAP_SEAMLESS
);
Manual Mipmap Generaon [8.14.4]
void GenerateMipmap(enum target);
target: TEXTURE_{1D, 2D, 3D}, TEXTURE_{1D, 2D}_ARRAY,
TEXTURE_CUBE_MAP{_ARRAY}
Texture View [8.18]
void TextureView(uint texture, enum target,
uint origtexture, enum internalformat,
uint minlevel, uint numlevels,
uint minlayer, uint numlayers);
target: TEXTURE_{1D, 2D,CUBE_MAP}{_ARRAY},
TEXTURE_3D, TEXTURE_{RECTANGLE, BUFFER},
TEXTURE_2D_MULTISAMPLE{_ARRAY}
internalformat: RGBA{16, 32}{F, UI, I},
RGBA{8,16}{_SNORM}, RGBA8{UI, I},
RGB{16, 32}{F, UI, I}, RGB{8,16}{_SNORM},
RGB8{UI, I}, RGB9_E5, RGB10_{A2UI, A2},
RG{16, 32}{F, UI, I}, RG{8,16}{_SNORM}, RG8{UI, I},
R{16, 32}{F, UI, I}, R{8,16}{_SNORM}, R8{UI, I},
R11F_G11F_B10F, SRGB8{_ALPHA8},
COMPRESSED{_SIGNED}_RED_RGTC1,
COMPRESSED{_SIGNED}_RG_RGTC2,
COMPRESSED_RGBA_BPTC_UNORM,
COMPRESSED_SRGB_ALPHA_BPTC_UNORM,
COMPRESSED_RGB_BPTC_{UN}SIGNED_FLOAT
Immutable-Format Tex. Images [8.19]
void TexStorage1D(enum target, sizei levels,
enum internalformat, sizei width);
target: TEXTURE_1D, PROXY_TEXTURE_1D
internalformat: any of the sized internal color, depth, and
stencil formats in
[Tables 8.18-20]
void TexStorage2D(enum target,
sizei levels, enum internalformat,
sizei width, sizei height);
target: {PROXY_}TEXTURE_{RECTANGLE, CUBE_MAP},
{PROXY_} TEXTURE_{1D_ARRAY, 2D}
internalformat:
see TexStorage1D
void TexStorage3D(enum target,
sizei levels, enum internalformat,
sizei width, sizei height, sizei depth);
target: TEXTURE_3D, PROXY_TEXTURE_3D,
{PROXY_}TEXTURE_{CUBE_MAP, 2D}{_ARRAY}
internalformat:
see TexStorage1D
void TexStorage2DMulsample(
enum target, sizei samples, enum
internalformat, sizei width, sizei height,
boolean xedsamplelocaons);
target: {PROXY_}TEXTURE_2D_MULTISAMPLE
void TexStorage3DMulsample(
enum target, sizei samples,
enum internalformat, sizei width,
sizei height, sizei depth,
boolean xedsamplelocaons);
target: {PROXY_}TEXTURE_2D_MULTISAMPLE
_ARRAY
Invalidang Texture Image Data [8.20]
void InvalidateTexSubImage(uint texture,
int level, int xoset, int yoset, int zoset,
sizei width, sizei height, sizei depth);
void InvalidateTexImage(uint texture,
int level);
Texture Image Loads/Stores [8.25]
void BindImageTexture(uint index,
uint texture, int level, boolean layered,
int layer, enum access, enum format);
access: READ_ONLY, WRITE_ONLY, READ_WRITE
format:
RGBA{32,16}F, RG{32,16}F, R11F_G11F_B10F,
R{32,16}F, RGBA{32,16,8}UI, RGB10_A2UI,
RG{32,16,8}UI, R{32,16,8}UI, RGBA{32,16,8}I,
RG{32,16,8}I, R{32,16,8}I, RGBA{16,8}, RGB10_A2,
RG{16,8}, R{16,8}, RGBA{16,8}_SNORM,
RG{16,8}_SNORM, R{16,8}_SNORM
[Table 8.25]
Vertex Specicaon
[10.2.1]
Specify generic aributes with components
of type oat (VertexArib*), int or uint
(VertexArib
I*), or double (VertexAribL*).
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,
LONG, NORMALIZED, SIZE, STRIDE, or TYPE
void GetVertexAribI{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 VertexArib{1234}{s f d}(uint index,
T values);
void VertexArib{123}{s f d}v(uint index,
const T *values);
void VertexArib4{b s i f d ub us ui}v(
uint index, const T *values);
void VertexArib4Nub(uint index,
T values);
void VertexArib4N{b si ub us ui}v(
uint index, const T *values);
void VertexAribI{1234}{i ui}(uint index,
T values);
void VertexAribI{1234}{i ui}v(uint index,
const T *values);
void VertexAribI4{b s ub us}v(uint index,
const T *values);
void VertexAribL{1234}d(uint index,
T values);
void VertexAribL{1234}dv(uint index,
const T *values);
void VertexAribP{1234}ui(uint index,
enum type, boolean normalized,
uint value);
void VertexAribP{1234}uiv(uint index,
enum type, boolean normalized,
const uint *value);
type: {UNSIGNED_}INT_2_10_10_10_REV
剩余11页未读,继续阅读
hzl2928963
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页