Vertex Array Object Question
I am learning OpenGL and the concept of VAO's are confusing me. What I know about them is that VAO's are there to allow you to use a single identifier to refer to multiple buffers that conceptually represent one "object." So if you have 2 buffers, one for vertex positions and another for vertex colors, then if you wanted to use these 2 buffers again to load into a vertex shader, all you would have to do is bind this VAO using glBindVertexArray. Do I have this right?
I have had trouble getting some examples working, but this is what I understand. When you create a VAO and bind it to make it active, any subsequent buffers you bind and load data into are automatically associated with the VAO that you just bound. Is this right? So if you bind another VAO identifier, then all subsequent buffer generations and binds are associated with this new VAO identifier.
1. generate 2 vao's
2. bind vao
3. gen buffer b1 and bind to a target and load data to it
4. bind vao
5. gen buffer b2 and bind to a target and load data to it
6. bind vao and call a draw command -> if b1 contained vertex data it would be drawn
7. bind vao and call a draw command -> if b2 contained vertex data it would be drawn
Appreciate your help