Jump to content
  • Advertisement
Sign in to follow this  
WilyCoder

Vertex Buffer Objects & Indices (part2)

This topic is 4767 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!