Jump to content
  • Advertisement
Sign in to follow this  
Rockard

glDrawArrays with specified number of vertexes per primitive

This topic is 3620 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

I'm currently making a rendering system for many types of objects using the VBO method. The objects may have varying numbers of vertices/object, and may also use different primitive types. If the primitive type is triangle or quad, rendering lots of these as some sort of 2d-sprite is not o problem since the start and stop-vertice is always assumed by this type of primitive type. But, when using any other type, like trianglestrip, I can't render a lots of these without them all being glued toghether. I can't sort them up in a batch of primitives since I can't specify the start and stop of each primitive object. So, did I miss something, or may this be possibly? Can I somehow tell the rendering system when using glRenderelements/glRenderArrays where the start and stops of the primitive type - like lines/trianglestrip/trianglefan - will be?

Share this post


Link to post
Share on other sites
Advertisement
I'd suggest uploading the vertex data to the GPU, creating an index list and then using glDrawRangeElements().

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!