// note that this is allowed, the call to glVertexAttribPointer registered VBO as the vertex attribute's bound vertex buffer object so afterwards we can safely unbind
glBindBuffer(GL_ARRAY_BUFFER,0);
// You can unbind the VAO afterwards so other VAO calls won't accidentally modify this VAO, but this rarely happens. Modifying other
// VAOs requires a call to glBindVertexArray anyways so we generally don't unbind VAOs (nor VBOs) when it's not directly necessary.
glBindVertexArray(0);
// Update the state (i.e., transform objects, create/destroy objects, ... )
}
...
...
@@ -19,11 +106,17 @@ void Simulator::present()
// Present the state to the user (i.e., render objects)
// For now, we just clear screen buffers and show some gui widget.
glBindVertexArray(VAO_global);// seeing as we only have a single VAO there's no need to bind it every time, but we'll do so to keep things a bit more organized
glDrawArrays(GL_TRIANGLES,0,3);
// glBindVertexArray(0); // no need to unbind it every time