You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In lecture_viewing3d, in the Mesh::init method on line 61 a buffer object is bound to the GL_ELEMENT_ARRAY_BUFFER target. This is never undone, nor is it redone in Mesh::draw.
By sheer chance nothing else is ever bound to this target so the code works, but if anyone uses this as a baseline/reference for anything in a more complicated system they're probably going to have quite the time finding the bug.
The text was updated successfully, but these errors were encountered:
Thanks Robert, the same will be true for a number of other calls :)
Our example code is not very rigorous in terms of memory clean-up and buffer unbinding.
A much better way of doing this would be by implementing a class that unbinds when the object falls out of scope. But in previous years students complained that by giving them a game-engine like framework they didn't learn anything of OpenGL. That's why the code it's the way it is now. It's a compromise!
In lecture_viewing3d, in the Mesh::init method on line 61 a buffer object is bound to the GL_ELEMENT_ARRAY_BUFFER target. This is never undone, nor is it redone in Mesh::draw.
By sheer chance nothing else is ever bound to this target so the code works, but if anyone uses this as a baseline/reference for anything in a more complicated system they're probably going to have quite the time finding the bug.
The text was updated successfully, but these errors were encountered: