I've been trying to figure out VAOs.
From what I read, VAOs store an array of vertex attributes.
What is not clear is how is this done and how is it beneficial?
I will write what I think is happening according to what I've read and please correct me if I'm wrong so I can develop full understanding on this matter.
1)Create the VAO
2)Bind it to make it current
3)Point to some attributes known to reside in the shader, and set some values to them using VertexAttribPointer()
!!--> The moment you do that, the VAO is updated as far as these attributes are concerned.
4) In the function were you do your drawing, berfore binding your VBOs first bind the VAO to make it current and activate
the values of the vertex attributes it contains.
5)Draw your scene using your VBOs.
BENEFIT: You only have to assign values to attributes once. At each drawing the program will refer to the VAO for the values of the attributes.
Thank you in advance.