Im using a VBO to store my indices for my triangles & tri strips. The first “chunk” in the VBO contain all the triangle indices and the rest is all the indices for my triangle strips.
In the render part to draw the triangles no problem, but when drawing the triangle strips, I do not know how and where I can pass the offset in the buffer, and what exactly to pass to glMultiDrawElementsEXT.
The following code was working perfectly with VA but when I switch it using VBO the Triangle Strips rendering cause me serious problem… I google a bit and cannot find not concrete example that is near what I do…
From the code below can someone give me an example of how to use glMultiDrawElements with VBOs…
I got the following code:
glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB,
tri_strip.element_index );
// Triangles
if( tri_strip.n_tri )
{
glDrawElements( GL_TRIANGLES,
tri_strip.n_tri,
GL_UNSIGNED_INT,
(GLvoid *)NULL );
}
// Triangle Strips
glMultiDrawElementsEXT( GL_TRIANGLE_STRIP,
&tri_strip.n_strip_cnt[0],
GL_UNSIGNED_INT,
(GLvoid **)NULL,
tri_strip.n_strip );
Thank in advance,
Cheers,