Original Post
Hi all,
Just to ask, is there performance difference for these 2 code?
Say that I am drawing 1000 quads. vert is the pointer to the vertices and texCoord is pointer to the texture coordinates. count is the number of vertices.
Method 1:
Method 2:
Just to ask, is there performance difference for these 2 code?
Say that I am drawing 1000 quads. vert is the pointer to the vertices and texCoord is pointer to the texture coordinates. count is the number of vertices.
Method 1:
glEnableClientState(GL_VERTEX_ARRAY);glEnableClientState(GL_TEXTURE_COORD_ARRAY);glVertexPointer(2, GL_FLOAT, 0, vert);glTexCoordPointer(2, GL_FLOAT, 0, texCoord);glDrawArrays(GL_QUADS, 0, count);glDisableClientState(GL_VERTEX_ARRAY);glDisableClientState(GL_TEXTURE_COORD_ARRAY);Method 2:
glEnableClientState(GL_VERTEX_ARRAY);glEnableClientState(GL_TEXTURE_COORD_ARRAY);glVertexPointer(2, GL_FLOAT, 0, vert);glTexCoordPointer(2, GL_FLOAT, 0, texCoord);for(int a=0; a<count; a+=4) glDrawArray(GL_QUADS, a, a+3);glDisableClientState(GL_VERTEX_ARRAY);glDisableClientState(GL_TEXTURE_COORD_ARRAY);