I have a mesh data structure with polygons that can be either triangles and quads. What is the fastest way to draw this using OpenGL?
The slow way is to iterate over the structure and for each polygon to make the appropriate glBegin() .. glEnd()
with either GL_QUADS
or GL_TRIANGLES
. I would like to avoid having to do glBegin() .. glEnd()
for each and every polygon.
Another option is to divide the structure into two structures, one containing the triangles and one containing the quads and then go over them separately. This is also something I'd like to avoid since I really want to keep them all in a single structure.
Unfortunately triangulating the quads into triangles is not an option at this time.
Is there a good solution to this?