glDrawRangeElements() question

If I want to render a scene containing triangles, quads, and polys using the glDrawRangeElements() method how would I accomplish this if all of my vertex related data is stored in a single array? As you guys know, the method needs to be informed as to which type of primitive you want to draw.

My first thought was to have a seperate array containing each type of data, and then make a seperate call to glDrawRangeElements() for each, but I would imagine there is a better solution :slight_smile:

I also thought of trying to store the triangle data first, then the quad, then the poly, all in the same array, then pick out each with a seperate call to glDrawRangeElements(), but that also seems tedious.

The upshot is that I am hoping for some very tidy yet simple answer :wink:

Thanks much

The short and simple answer you are hoping for is that you simply call glDrawRangeElements for each type of primitive you wish to render.

For various reasons you will probably find that keeping all the various data separate is easier.

Cas :slight_smile:

That was a quick and direct response…thank you :slight_smile: