use the same vao to draw all objects

Hi,

Can we use the same VAO and program to draw all objects ( if we have the same attributes location ) ?

or we have to generate and bind a VAO for every object we need to draw ?

Thanks.

You can use a single VAO and use glVertexAttribPointer (or glBindVertexBuffer on sufficiently new versions) calls before drawing to change which buffer provides the actual vertex data.
Since use of VAO became mandatory on core contexts one scheme to upgrade older code is to create and bind a single VAO during application initialization and otherwise ignore VAOs.

ok, thank you :).