View Full Version : use the same vao to draw all objects

11-21-2015, 02:05 PM

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 ?


carsten neumann
11-21-2015, 02:19 PM
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.

11-21-2015, 03:34 PM
ok, thank you :).