GLMULTIDRAWARRAYSEXT(3gl)GLMULTIDRAWARRAYSEXT(3gl)NAME
glMultiDrawArrays - render multiple primitives from array data
glMultiDrawArraysEXT - render multiple primitives from array data
glMultiDrawArraysSUN - render multiple primitives from array data
C SPECIFICATION
void glMultiDrawArrays( GLenum mode,
GLint* first,
GLsizei* count,
GLsizei primcount )
void glMultiDrawArraysEXT( GLenum mode,
GLint* first,
GLsizei* count,
GLsizei primcount )
void glMultiDrawArraysSUN( GLenum mode,
GLint* first,
GLsizei* count,
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_TRIAN‐
GLE_LIST_SUN are accepted.
first Points to an array of starting indices in the enabled
arrays.
count Points to an array of the number of indices to be rendered.
primcount Specifies the size of first and count arrays.
DESCRIPTION
glMultiDrawArrays specifies multiple geometric primitives with very few
subroutine calls. Instead of calling a GL procedure to pass each indi‐
vidual vertex, normal, texture coordinate, edge flag, or color, you
can prespecify separate arrays of vertexes, normals, and colors and use
them to construct a sequence of primitives with a single call to
glMultiDrawArrays.
When glMultiDrawArrays is called, it uses primcount sets of first and
count values. For each pair of index and count values, glMultiDrawAr‐
rays uses count sequential elements from each enabled array to con‐
struct a sequence of geometric primitives, beginning with element
first. mode specifies what kind of primitives are constructed, and how
the array elements construct those primitives. If GL_VERTEX_ARRAY is
not enabled, no geometric primitives are generated.
Vertex attributes that are modified by glMultiDrawArrays have an
unspecified value after glMultiDrawArrays returns. For example, if
GL_COLOR_ARRAY is enabled, the value of the current color is undefined
after glMultiDrawArrays executes. Attributes that aren't modified
remain well defined.
glMultiDrawArrays(mode, first, count, primcount) is functionally equiv‐
alent to:
for (i=0; i<primcount; i++) {
if (count[i]>0) glDrawArrays(mode,first[i],count[i]); }
NOTES
glMultiDrawArrays is included in display lists. If glMultiDrawArrays is
entered into a display list, the necessary array data (determined by
the array pointers and enables) is also entered into the display 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.
glMultiDrawArrays is functionally equivalent to glMultiDrawArraysEXT
and glMultiDrawArraysSUN.
glMultiDrawArrays is only available if the GL version is 1.4 or
greater.
glMultiDrawArraysEXT is only available if GL_EXT_multi_draw_arrays is
included in the string returned by glGetString, when called with argu‐
ment GL_EXTENSIONS.
glMultiDrawArraysSUN is only available if GL_SUN_multi_draw_arrays is
included in the string returned by glGetString, when called with argu‐
ment 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 glMultiDrawArraysEXT is executed
between the execution of glBegin and the corresponding glEnd.
SEE ALSO
glArrayElement, glColorPointer, glDrawElements, glEdgeFlagPointer,
glGetPointerv, glIndexPointer, glInterleavedArrays, glNormalPointer,
glTexCoordPointer, glVertexPointer, glReplacementCodePointerSUN,
glDrawArrays
28 April 98 GLMULTIDRAWARRAYSEXT(3gl)