I have two vertex array objects. I defined as follows:
GLuint vao[2]
glGenVertexArrays(2, vao);// binds the first object to be drawn
glBindVertexArray(vao[0]);//binds the second object to be drawn
glBindVertexArray(vao[1]);
My question is, is it okay to define two vertex array objects like these for drawing two objects?
Because when I use the following syntax with glGenVertexArrays(1, vao) instead of glGenVertexArrays(2, vao), it gives the same result, but I associate two objects with two indices (0, 1) of the vertex array objects…
glGenVertexArrays(1, vao);
// binds the first object to be drawn
glBindVertexArray(vao[0]);//binds the second object to be drawn
glBindVertexArray(vao[1]);
Can anyone explain me why?
Thanks in advance.