suriogl
02-25-2010, 02:02 AM
GLfloat Vertices[] = {
-0.75, -0.12,
-0.75, 0.12,
0.75, 0.12,
0.75, -0.12 };
1. using GL_TRIANGLE_FAN
glColor3f (1.0f, 0.0f, 0.0f);
glVertexPointer (2, GL_FLOAT, 0, Vertices);
glDrawArrays (GL_TRIANGLE_FAN, 0, 4);
2. using GL_QUADS
glColor3f (1.0f, 0.0f, 0.0f);
glVertexPointer (2, GL_FLOAT, 0, Vertices);
glDrawArrays (GL_QUADS, 0, 4);
Both 1 and 2 draw rectangle. Does it make any difference with respect to the performance? Which one is easier for OpenGL to draw?
-0.75, -0.12,
-0.75, 0.12,
0.75, 0.12,
0.75, -0.12 };
1. using GL_TRIANGLE_FAN
glColor3f (1.0f, 0.0f, 0.0f);
glVertexPointer (2, GL_FLOAT, 0, Vertices);
glDrawArrays (GL_TRIANGLE_FAN, 0, 4);
2. using GL_QUADS
glColor3f (1.0f, 0.0f, 0.0f);
glVertexPointer (2, GL_FLOAT, 0, Vertices);
glDrawArrays (GL_QUADS, 0, 4);
Both 1 and 2 draw rectangle. Does it make any difference with respect to the performance? Which one is easier for OpenGL to draw?