I’m having problems using glMultidrawElements and Vertex Buffer Objects for indices and vertices. I have read all other posts abouts this, and it didn’t solve anything.
I can only get my application crashing when calling to glMultiDrawElementsEXT.
I won’t ask it again, so:
I would like you to post some peace of code getting that working, of send me the code to mail: jesus.gumbau AT anubis.uji.es.
I don’t see any bad thing at first glance. You may have a look at your gl*EXT func (do you load those extensions well ?). According you use VBO without any problem, I might be wrong.
But according that you only use glDrawElements to compare your result, I wonder.
void glMultiDrawElementsEXT(
GLenum mode,
GLsizei *count,
GLenum type,
const GLvoid **indices,
GLsizei primcount)
mode - GL_TRIANGLES or GL_TRIANGLE_STRIP or...
count - POINTER to system memory array that contain counts for each pointer in indices
type - GL_UNSIGNED_INT or some other GL type
indices - array of pointers to start pointer of each "subdraw" call.
primcount - number of pointers in batches
In your case make sure in following:
Count should be a SYSTEM MEMORY pointer to number of primitives for each batch… ie. count.size() MUST BE EQUAL to indices.size() and it EQUAL to primcount;
If you use VBO to store indices pointer count and indices MUST BE in SYSTEM MEMORY but indices[n] MUST BE OFFSET in VBO MEMORY.
Make sure that you really use unsigned int for indices.
btw… this code show how glMultiDrawElementsEXT really works: