Suppose I have 2 different objects, each one has its own VAO and draw call. Something like this:
void Object::Draw() {
glBindVertexArray(vao);
glDrawArrays(GL_TRIANGLES, foo, bar);
}
First I call the first object's draw call which binds its VAO and renders it. Then, I do the same thing for the second object.
I know this will work and both objects will be rendered. My question is why. What happens in OpenGL's state when I bind a VAO without unbinding any other previously bound VAOs?