Opengl SuperBible 7th摘抄

OpenGL SuperBible学习第五章Data1. void glCreateBuffers(GLsizei n, GLuint* buffers);buffers is the address of the variable or variables that will be used to store the names of the buffer objects.
摘要由CSDN通过智能技术生成


OpenGL SuperBible学习
第五章
Data

1. void glCreateBuffers(GLsizei n, GLuint* buffers);
buffers is the address of the variable or variables that will be used to store the names of the buffer objects.

2. void glBindBuffer(GLenum target, GLuint buffer);

3. The functions that are used to allocate memory using a buffer object are glBufferStorage() and glNamedBufferStorage(). Their protetypes are
void glBufferStorage(GLenum target, GLsizeptr size, const void* data, GLbitfield flags);
void glNamedBufferStorage(GLuint uffer, GLsizeptr size, const void* data, GLbitfield flags);

4. To be clear, the contents of the buffer object's data store can be changed, but its size or usage flags may not.

5. There are a handful of ways to get dat into the buffer object.

6. Had we instead supplied a pointer to some data, that data would have been used to initialize the buffer object. Using this pointer ,however, allow us to set only the initial data to be stored in the buffer.

7. void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
void glNameBufferSubData(Gluint buffer, GLintptr offset, GLsizeiptr size, const void* data);

8. void* glMapBuffer(GLenum target, GLenum usage);
void* glMapNamedBuffer(GLuint buffer, GLenum usage);
one that affects the buffer bound to one fo the targets of the current context, and one that operates directly on a buffer whose name you specify.

9. If you map a buffer, you can simply read the contents of the file directly into the mapped buffer.

10. void* glMapBufferRange(GLenum target, GLintptr offset, GLsizeptr length, GLbitfield access);
void* glMapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
These functions, rather than mapping the entire buffer object map only a specific range of the buffer object.

11. However, because of the additional control and stronger contract provided by glMapBufferRange() and glMapNamedBufferRange(), it is generally preferred to call these functions rather than glMapNamedBuffer().


12. glClearBufferSubData -- glClearNamedBufferSubData
glCopyBufferSubData -- glCopyNamedBufferSubData

13. To tell OpenGL which buffer object our data is in and where in that buffer object the data resides, we use the glVertexArrayVertexBuffer() function to bind a buffer to one of the vertex buffer bindings. We use the glVertexArrayAttribFormat() function to describe the layout and format of the data, and finally we enable automatic filling of the attribute by calling glEnableVertexAttribArray().

14. OpenGL allows you to combine a group of uniforms into a uniform block and store the whole block in a
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值