OpenGL缓冲对象:API列表

  1. O

    penGL缓冲对象概念

  2. 缓冲区对象 Buffer Objects API列表

  1. 缓冲区对象 Buffer Objects
  2. 创建和绑定缓冲区对象 Creating and Binding Buffer Objects
  3. 创建缓冲对象数据存储 Creating Buffer Object Data Stores
  4. 修改缓冲对象数据存储 Modifying Buffer Object Data Stores
  5. Clear缓冲对象数据存储 Clear Buffer Object Data Stores
  6. 映射映射缓冲数据 Mapping Buffer Data
  7. 刷新映射缓冲数据 Flush Buffer Data
  8. 取消映射缓冲数据 Unmapping Buffer Data
  9. 使缓冲区数据无效 Invalidating Buffer Data
  10. 缓冲区间复制 Copying Between Buffers
  11. 缓冲对象查询 Buffer Object Queries

缓冲区对象 Buffer Objects

void glGenBuffers( sizei n, uint *buffers );

void glCreateBuffers( sizei n, uint *buffers );

void glDeleteBuffers( sizei n, const uint *buffers );

boolean glIsBuffer( uint buffer );
  • 创建和绑定缓冲区对象 Creating and Binding Buffer Objects
void glBindBuffer( enum target, uint buffer );
void glBindBufferRange( enum target, uint index,uint buffer, intptr offset, sizeiptr size );

void glBindBufferBase( enum target, uint index, uint buffer );

void glBindBuffersBase( enum target, uint first, sizei count, const uint *buffers );
// 等价于
// for (i = 0; i < count; i++) {
//     if (buffers == NULL) {
//         glBindBufferBase(target, first + i, 0);
//     } else {
//         glBindBufferBase(target, first + i, buffers[i]);
//     }
// }

void glBindBuffersRange( enum target, uint first,sizei count, const uint *buffers, const intptr *offsets, const sizeiptr *sizes );
// 等价于
// for (i = 0; i < count; i++) {
//     if (buffers == NULL) {
//         glBindBufferRange(target, first + i, 0, 0, 0);
//     } else {
//         glBindBufferRange(target, first + i, buffers[i],offsets[i], sizes[i]);
//     }
// }
  • 创建和修改缓冲对象数据存储 Creating and Modifying Buffer Object Data Stores
void glBufferStorage( enum target, sizeiptr size, constvoid *data, bitfield flags );

void glNamedBufferStorage( uint buffer, sizeiptr size,const void *data, bitfield flags );

void glBufferData( enum target, sizeiptr size, constvoid *data, enum usage );

void glNamedBufferData( uint buffer, sizeiptr size, constvoid *data, enum usage );

void glBufferSubData( enum target, intptr offset,sizeiptr size, const void *data );

void glNamedBufferSubData( uint buffer, intptr offset,sizeiptr size, const void *data );
void glClearBufferSubData( enum target, enum internalformat, intptr offset, sizeiptr size, enum format, enum type, const void *data );

void glClearNamedBufferSubData( uint buffer,enum internalformat, intptr offset, sizeiptr size, enum format, enum type, const void *data );

void glClearBufferData( enum target, enum internalformat,enum format, enum type, const void *data );
// 等价于
// glClearBufferSubData(target, internalformat, 0, size, format, type, data);

void glClearNamedBufferData( uint buffer,enum internalformat, enum format, enum type, constvoid *data );
// 等价于
// glClearNamedBufferSubData(buffer, internalformat, 0, size, format, type, data);
  • 映射和取消映射缓冲数据 Mapping and Unmapping Buffer Data
void *glMapBufferRange( enum target, intptr offset,sizeiptr length, bitfield acesss );

void *glMapNamedBufferRange( uint buffer, intptr offset,sizeiptr length, bitfield access );

void *glMapBuffer( enum target, enum access );
// 等价于
// glMapBufferRange(target, 0, length, flags);

void *glMapNamedBuffer( uint buffer, enum access );
// 等价于
// glMapNamedBufferRange(buffer, 0, length, flags);

void glFlushMappedBufferRange( enum target, intptr offset,sizeiptr length );

void glFlushMappedNamedBufferRange( uint buffer,intptr offset, sizeiptr length );

boolean glUnmapBuffer( enum target );

boolean glUnmapNamedBuffer( uint buffer );
  • 使缓冲区数据无效 Invalidating Buffer Data
void glInvalidateBufferSubData( uint buffer, intptr offset,sizeiptr length );

void glInvalidateBufferData( uint buffer );
// 等价于
// glInvalidateBufferSubData( buffer, 0, BUFFER_SIZE );
  • 缓冲区间复制 Copying Between Buffers
void glCopyBufferSubData( enum readTarget, enum writeTarget,intptr readOffset, intptr writeOffset, sizeiptr size );

void glCopyNamedBufferSubData( uint readBuffer,uint writeBuffer, intptr readOffset, intptr writeOffset,sizeiptr size );
  • 缓冲对象查询 Buffer Object Queries
void glGetBufferParameteriv( enum target, enum pname,int *data );

void glGetBufferParameteri64v( enum target, enum pname,int64 *data );

void glGetNamedBufferParameteriv( uint buffer,enum pname, int *data );

void glGetNamedBufferParameteri64v( uint buffer,enum pname, int64 *data );

void glGetBufferSubData( enum target, intptr offset,sizeiptr size, void *data );

void glGetNamedBufferSubData( uint buffer, intptr offset,sizeiptr size, void *data );

void glGetBufferPointerv( enum target, enum pname, const void **params );

void glGetNamedBufferPointerv( uint buffer, enum pname,const void **params );