I have a grid data structure with polygons, which can be either triangles or squares. What is the fastest way to do this using OpenGL?
The slowest way is to iterate over the structure and for each polygon to do the corresponding glBegin() .. glEnd()with GL_QUADSor GL_TRIANGLES. I would like to avoid glBegin() .. glEnd()for each and every polygon.
Another option is to divide the structure into two structures: one containing triangles, and one containing squares, and then go through them separately. This is also something that I would like to avoid, since I really want to keep them all in one structure.
Unfortunately, triangulating quadrants into triangles is currently not an option.
Is there a good solution for this?
source
share