The glArrayElement function specifies the array elements used to render a vertex.
void glArrayElement(
GLint index
);
Use the glArrayElement function within glBegin and glEnd pairs to specify vertex and attribute data for point, line, and polygon primitives. The glArrayElement function specifies the data for a single vertex using vertex and attribute data located at the index of the enabled vertex arrays.
You can use glArrayElement to construct primitives by indexing vertex data, rather than by streaming through arrays of data in first-to-last order. Because glArrayElement specifies a single vertex only, you can explicitly specify attributes for individual primitives. For example, you can set a single normal for each individual triangle.
When you include calls to glArrayElement in display lists, the necessary array data, determined by the array pointers and enable values, is entered in the display list also. Array pointer and enable values are determined when display lists are created, not when display lists are executed.
You can read and cache static array data at any time with glArrayElement. When you modify the elements of a static array without specifying the array again, the results of any subsequent calls to glArrayElement are undefined.
When you call glArrayElement without first calling glEnableClientState(GL_VERTEX_ARRAY), no drawing occurs, but the attributes corresponding to enabled arrays are modified. Although no error is generated when you specify an array within glBegin and glEnd pairs, the results are undefined.
Windows NT: Use version 3.5 and later.
Windows: Use Windows 95 and later.
Windows CE: Unsupported.
Header: Declared in gl.h.
Import Library: Link with opengl32.lib.
glBegin, glColorPointer, glDrawArrays, glEdgeFlagPointer, glEnableClientState, glEnd, glGetPointerv, glGetString, glIndexPointer, glNormalPointer, glTexCoordPointer, glVertexPointer