I'm having rather strange problem with OpenGL. When I try to use glVertexPointer
with no buffer bound to GL_ARRAY_BUFFER
and using Vertex Array Object(VAO), it generates invalid operation error. This error is nowhere in documentation of glVertexPointer
.
When I generate buffer and bind it to GL_ARRAY_BUFFER
, error disappears, but as I have my data stored on RAM, I bind 0 and use pointer to RAM. Als开发者_如何转开发o by not binding VAOs I don't get error anymore, but I've noticed that when I don't use it, my other things further in program gets corrupted.
Maybe I've missed somewhere that setting pointers, while VAO is bound and buffer is not, is going to be invalid invalid operation? Theoretically I could move those data to VBOs and don't bother, but I'd like to know why's this happening.
The extension registry for ARB_vertex_array_object clearly states, that they cannot be used with client-side arrays. This shouldn't be different for the core OpenGL versions supporting VAOs and is due to the fact, that VAOs are server-state. So it is completely expected behaviour to get an invalid operation error. Just store everything in VBOs (maybe using GL_DYNAMIC_DRAW
or GL_STREAM_DRAW
as usage if the data changes frequently).
精彩评论