I'm working with a js/wasm/c++ program that uses object oriented programming when updating the OpenGL state. There are corresponding c++ classes for VBOs (vertex buffer) and VAOs (vertex array). When we call vao.unbind();
, it simply calls glBindVertexArray(0);
. I'm seeing that unbinding the VAO does not unbind the corresponding VBOs. One of the VAO's VBOs was still set as ARRAY_BUFFER_BINDING target.
My question is: is it best practice to automatically unset the associated VBOs when you unset the VAO? Or should I write a separate function that unsets the VAO's VBOs?
With WebGL I'm seeing that it does not unbind the VBO when you unset the VAO, despite what this reddit post is saying.