Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenGL: Which is faster - GL_POLYGON or GL_TRIANGLE_FAN?

Tags:

opengl

I am going to draw a regular hexagon with one fill color. I can do it with a sequence of glVertex2*() calls. However, the glBegin() call is what I am asking about. Is there any benefit to using GL_POLYGON or GL_TRIANGLE_FAN? If it matters, drawing hexes will be the main work of the program. If you have another idea, I am all ears.

like image 810
No One in Particular Avatar asked Apr 05 '11 23:04

No One in Particular


1 Answers

GL_POLYGON is deprecated in OpenGL 3.x. I think most drivers convert GL_POLYGON to a bunch of triangles, you can save the conversion by providing triangles in the first place.

like image 97
Ben Voigt Avatar answered Sep 20 '22 22:09

Ben Voigt