void glGenBuffers( GLsizei n, GLuint * buffers)
产生buffers名称
变量 | 意义 |
---|
n | 生成buffers的个数 |
buffers | 生成n个buffers的name |
void glBindBuffer( GLenum target, GLuint buffer)
设定buffer的类别
变量 | 意义 |
---|
target | 绑定的buffer类别 |
buffer | 绑定的buffer |
target类别 | 解释 |
---|
GL_ARRAY_BUFFER | Vertex attributes |
GL_ATOMIC_COUNTER_BUFFER | Atomic counter storage |
GL_COPY_READ_BUFFER | Buffer copy source |
GL_COPY_WRITE_BUFFER | Buffer copy destination |
GL_DISPATCH_INDIRECT_BUFFER | Indirect compute dispatch commands |
GL_DRAW_INDIRECT_BUFFER | Indirect command arguments |
GL_ELEMENT_ARRAY_BUFFER | Vertex array indices |
GL_PIXEL_PACK_BUFFER | Pixel read target |
GL_PIXEL_UNPACK_BUFFER | Texture data source |
GL_QUERY_BUFFER | Query result buffer |
GL_SHADER_STORAGE_BUFFER | Read-write storage for shaders |
GL_TEXTURE_BUFFER | Texture data buffer |
GL_TRANSFORM_FEEDBACK_BUFFER | Transform feedback buffer |
GL_UNIFORM_BUFFER | Uniform block storage |
void glBufferData( GLenum target,GLsizeiptr size,const GLvoid * data,GLenum usage)
创建并初始化buffer的存储空间
变量 | 意义 |
---|
target | 制定绑定对象的类型,解释见上 |
size | 数据所需空间大小 |
data | 初始化buffer的数据,没有为空 |
usage | 指定buffer的预期使用模式,可能会影响对buffer使用的性能,主要表现在频率和性能,常用的有:GL_STREAM_DRAW, GL_STREAM_READ, GL_STREAM_COPY, GL_STATIC_DRAW, GL_STATIC_READ, GL_STATIC_COPY, GL_DYNAMIC_DRAW, GL_DYNAMIC_READ, or GL_DYNAMIC_COPY |
usage | 意义 |
---|
STREAM | The data store contents will be modified once and used at most a few times. |
STATIC | The data store contents will be modified once and used many times. |
DYNAMIC | The data store contents will be modified repeatedly and used many times. |
DRAW | The data store contents are modified by the application, and used as the source for GL drawing and image specification commands. |
READ | The data store contents are modified by reading data from the GL, and used to return that data when queried by the application. |
COPY | The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands. |
void glDeleteBuffers( GLsizei n,const GLuint * buffers)
删除buffers
变量 | 意义 |
---|
n | 生成buffers的个数 |
buffers | 生成n个buffers的name |
参考链接:https://www.khronos.org/registry/OpenGL-Refpages/gl4/