Hi everyone,
I’m trying to upgrade some legacy OpenGL 1.0 code, but I don’t understand how to use efficiently VertexArrayObjects and VertexBufferObjects. Drawing one line strip is OK, but how to draw many lines at once ?
Formerly:
glNewList(MYLIST, GL_COMPILE);
{
// 30 to 50 linestrips of different lengths
glBegin(GL_LINE_STRIP);
{
...
}
glEnd();
....
glBegin(GL_LINE_STRIP);
{
...
}
glEnd();
}
glEndList();
Should it be something like an array of VBOs, and one VAO to rule them all and on the GPU bind them ?
vao.bind();
for(int i=0; i<vbo.size(); i++)
{
vbo[i].create();
vbo[i].bind();
vbo[i].allocate(vertices, sizeof(vertices));
vbo[i].release();
}
vao.release();
BTW, I’m using the Qt5 framework.
Any insight will be greatly appreciated.