Vertex Array Objects - Confusion regarding exactly what state information is saved about the currently bound vertex buffer

后端 未结 1 1238
心在旅途
心在旅途 2021-02-08 19:09

I\'m working through the excellent tutorials at arcsynthesis while building a graphics engine and have discovered I don\'t understand VAOs as much as I thought I had.

F

1条回答
  •  醉话见心
    2021-02-08 19:49

    Do I only need to call glBindBuffer again if I change the data in the buffer?

    Yes, The VAO object remembers which buffers were bound each time you called glVertexAttribPointer whilst that VAO was bound, so you don't usually need to call glBindBuffer again. If you want to change the data in the buffer however, OpenGL needs to know which buffer you are changing, so you need to call glBindBuffer before calling glBufferData. It is irrelevant which VAO object is bound at this point.

    0 讨论(0)
提交回复
热议问题