User:Eric B. and Rakim/vertex arrays
|
In OpenGL terminology, a vertex array is a list of vertices that form a number of polygons that can be drawn at once. The relevant GL commands are:
-
void glDrawArrays(GLenum mode, GLint first, GLsizei count)
-
void glVertexPointer(GLint sizei, GLenum type, GLsizei stride, const GLvoid * pointer)
-
void glTexCoordPointer(GLint size, GLenum type,
GLsizei stride, const GLvoid * pointer)
-
void glDrawElements(GLenum 'size, GLenum type, GLsizei stride, const GLvoid * pointer)
-
void glEnable/glDisable(GLenum cap)
-
void glEnableClientState/glDisableClientState(GLenum cap)
Using these commands, the drawing efficiency can more than double compared to using slower glBegin
/glEnd
sequences.
Contents |
Concept
Using vertex arrays
Examples
External links
- 2.8 Vertex Arrays (http://www.opengl.org/documentation/specs/version1.1/glspec1.1/node21.html)
- Vertex Arrays (http://www.codecolony.de/docs/VertexArrays.htm)