I've been having trouble using glDrawRangeElements as I thought I should be able to. I have the VBO generated and populated. I can draw the entire object just fine. Now, I want to be able to draw, say, only the first half or second half of the object. So I tried modifying the start, end, and count parameters.
In my original code that draws the entire object properly, I have:
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, Triangles.VBOName);
glDrawRangeElements(GL_TRIANGLES, 0, Triangles.IndexCurrentSize, Triangles.IndexCurrentSize, GL_UNSIGNED_INT, 0);
I'm trying to modify it to do something like:
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, Triangles.VBOName);
glDrawRangeElements(GL_TRIANGLES, start_buffer, stop_buffer, stop_buffer - start_buffer, GL_UNSIGNED_INT, 0);
start_buffer is where in the buffer I want to start drawing, stop_buffer is where I want to end, and stop_buffer - start_buffer should be the count, the size of the buffer to draw. I've ensured that start and stop are multiples of 3. When I try this, stuff draws, but not the triangles I expect. Any ideas?