cginternals / globjects

C++ library strictly wrapping OpenGL objects.
https://globjects.org
MIT License
538 stars 59 forks source link

Fix transform feedback example #285

Closed sbusch42 closed 9 years ago

sbusch42 commented 9 years ago

It seems that the TransformFeedback object has to be bound before calling glBindBufferBase on a buffer, otherwise the formerly bound buffer remains active, resulting in GL_INVALID_OPERATION ("Buffer is mapped.") errors, because the same buffer is used for reading and writing.

The example previously worked by chance, because m_transformFeedback->draw() internally calls bind(), so the object will already be bound in the next frame. Remove the draw call in the previous version of the example to reproduce the error.