GLMULTIDRAWELEMENTSEXT(3gl)GLMULTIDRAWELEMENTSEXT(3gl)NAME
glMultiDrawElements - render multiple primitives from array data
glMultiDrawElementsEXT - render multiple primitives from array data
glMultiDrawElementsSUN - render multiple primitives from array data
C SPECIFICATION
void glMultiDrawElements( GLenum mode,
GLsizei* count,
GLenum type,
const GLvoid **indices,
GLsizei primcount)
void glMultiDrawElementsEXT( GLenum mode,
GLsizei* count,
GLenum type,
const GLvoid **indices,
GLsizei primcount)
void glMultiDrawElementsSUN( GLenum mode,
GLsizei* count,
GLenum type,
const GLvoid **indices,
GLsizei primcount)
PARAMETERS
mode Specifies what kind of primitives to render. Symbolic con‐
stants GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES,
GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES,
GL_QUAD_STRIP, GL_QUADS, GL_POLYGON, and GL_TRIANGLE_LIST_SUN
are accepted.
count Specifies a pointer to an array of element counts.
type Specifies the type of the values in indices. Must be one of
GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, or GL_UNSIGNED_INT.
indices Specifies a pointer to an array of locations where the indices
are stored.
primcount
Specifies the size of the count and indices arrays.
DESCRIPTION
glMultiDrawElements specifies multiple geometric primitives with very
few subroutine calls. Instead of calling a GL function to pass each
individual vertex, normal, texture coordinate, edge flag, or color, you
can prespecify separate arrays of vertexes, normals, and so on and use
them to construct a sequence of primitives with a single call to glMul‐
tiDrawElements.
When glMultiDrawElements is called, it uses primcount sets of indices
and count values. For each pair of indices and count it uses count
sequential elements from an enabled array, starting at indices to con‐
struct a sequence of geometric primitives. mode specifies what kind of
primitives are constructed, and how the array elements construct these
primitives. If more than one array is enabled, each is used. If GL_VER‐
TEX_ARRAY is not enabled, no geometric primitives are constructed.
Vertex attributes that are modified by glMultiDrawElements have an
unspecified value after glMultiDrawElements returns. For example, if
GL_COLOR_ARRAY is enabled, the value of the current color is undefined
after glMultiDrawElements executes. Attributes that aren't modified
remain well defined.
glMultiDrawElements(mode, count, type, indices,primcount) is function‐
ally equivalent to:
for (i=0; i<primcount; i++) {
if (count[i]>0) glDrawElements(mode,count[i],type,indices[i]);
}
NOTES
glMultiDrawElements is included in display lists. If glMultiDrawEle‐
ments is entered into a display list, the necessary array data (deter‐
mined by the array pointers and enables) is also entered into the dis‐
play list. Because the array pointers and enables are client-side
state, their values affect display lists when the lists are created,
not when the lists are executed.
glMultiDrawElements is functionally equivalent to glMultiDrawElement‐
sEXT and glMultiDrawElementsSUN.
glMultiDrawElements is only available if GL version is 1.4 or greater.
glMultiDrawElementsEXT is only available if GL_EXT_multi_draw_arrays
is included in the string returned by glGetString, when called with
argument GL_EXTENSIONS.
glMultiDrawElementsSUN is only available if GL_SUN_multi_draw_arrays
is included in the string returned by glGetString, when called with
argument GL_EXTENSIONS.
ERRORS
GL_INVALID_ENUM is generated if mode is not an accepted value.
GL_INVALID_VALUE is generated if primcount is negative.
GL_INVALID_OPERATION is generated if glMultiDrawElementsEXT is executed
between the execution of glBegin and the corresponding glEnd.
SEE ALSO
glArrayElement, glColorPointer, glDrawArrays, glMultiDrawElementsEXT,
glEdgeFlagPointer,
glGetPointerv, glIndexPointer, glInterleavedArrays, glNormalPointer,
glTexCoordPointer, glVertexPointer, glReplacementCodePointerSUN
28 April 98 GLMULTIDRAWELEMENTSEXT(3gl)