Vertex Buffer Objects & Indices (part2)

Started by
2 comments, last by WilyCoder 18 years, 9 months ago
Why would the following line NOT render

glDrawRangeElements(GL_TRIANGLES,0,(m->NumberOfTriangles*3)-1,0,GL_UNSIGNED_INT,0);



But this call DOES render:

glDrawElements(GL_TRIANGLES,m->NumberOfTriangles*3,GL_UNSIGNED_INT,0);



[Edited by - WilyCoder on June 30, 2005 3:34:21 PM]
Advertisement
because evil forces have aligned against you...
(aka, not enuff infomation)
youre using it incorrectly read the spec

void DrawRangeElements( enum mode, uint start,
uint end, sizei count, enum type, void *indices );
is a restricted form of DrawElements. mode, count, type, and indices match the
corresponding arguments to DrawElements, with the additional constraint that all
values in the array indices must lie between start and end inclusive.
EDIT: I fixed it :)

Here are the correct parameters for win32 opengl (didnt test on linux yet):

Breakdown of the parameters:
Type: GL_TRIANGLES,etc
Start: - Start with first index in the array of indices
End: - The last index of array
Size: How many indices you want drawn
Type: GL_UNSIGNED_INT,etc
Pointer To Indices: set to 0 if using VBOs

I had seen a few different versions of glDrawRangeElements() on the net....

Zeek: Good call :)

[Edited by - WilyCoder on June 30, 2005 11:23:34 PM]

This topic is closed to new replies.

Advertisement