Sign in to follow this  
WilyCoder

Vertex Buffer Objects & Indices (part2)

Recommended Posts

WilyCoder    100
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]

Share this post


Link to post
Share on other sites
zedzeek    529
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.

Share this post


Link to post
Share on other sites
WilyCoder    100
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]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this