glDrawRangeElementsEXT
NAME
glDrawRangeElementsEXT - render primitives from array data
C SPECIFICATION
void glDrawRangeElementsEXT(GLenum mode,
GLsizei count,
GLuint start,
GLuint end,
GLenum type,
const GLvoid *indices)
PARAMETERS
mode
| Specifies what kind of primitives to render. Symbolic constants
GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP,
GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS, and GL_POLYGON
are accepted.
|
count
| Specifies the number of elements to be rendered.
|
start
| Specifies the minimum index number that will be accessed.
|
end
| Specifies the maximum index number that will be accessed.
|
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 the location where the indices are stored.
|
DESCRIPTION
glDrawRangeElementsEXT is a restricted form of
glDrawElements. All
vertices referenced by indices must lie between
start and end inclusive. Not all vertices
between start and end must be referenced, however
unreferenced vertices may be sent through some of the vertex pipeline
before being discarded, reducing performance from what could be achieved
by an optimal index set. Index values which lie outside the range will
cause implementation-dependent results.
glDrawRangeElementsEXT may also be further constrained to only operate
at maximum performance for limited amounts of data. Implementations may
advertise recommended maximum amounts of vertex and index data using the
GL_MAX_ELEMENTS_VERTICES_EXT and GL_MAX_ELEMENTS_INDICES_EXT constants.
If a particular call to glDrawRangeElementsEXT has
(end - start + 1) greater
than GL_MAX_ELEMENTS_VERTICES_EXT or if count is greater than
GL_MAX_ELEMENTS_INDICES, the implementation may be forced to
process the data less efficiently than it could have with less data.
An implementation which has no effective limits can advertise the maximum
integer value for the two constants. An implementation must always
process a glDrawRangeElementsEXT call with valid parameters regardless
of the amount of data passed in the call.
The parameters mode, count, type, and indices
behave exactly the same as in the function glDrawElements.
NOTES
glDrawRangeElementsEXT is included in display lists. If glDrawRangeElementsEXT
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.
EXTENSIONS
Some routines and constants for this function are part of an extension, not part of the
core GL command set. The following extension names must be present in the string returned by
glGetString when called with argument GL_EXTENSIONS
to use these routines and constants.
- GL_EXT_draw_range_elements
- glDrawRangeElementsEXT, GL_MAX_ELEMENTS_VERTICES_EXT, and
GL_MAX_ELEMENTS_INDICES_EXT are part of the EXT_draw_range_elements
extension.
ERRORS
GL_INVALID_ENUM is generated if mode is not an accepted value.
GL_INVALID_VALUE is generated if count is negative.
GL_INVALID_OPERATION is generated if glDrawRangeElementsEXT is
executed between the execution of glBegin and the
corresponding glEnd.
GL_INVALID_VALUE will be returned if end is less than start.
SEE ALSO
glArrayElement,
glColorPointer,
glDrawArrays,
glDrawElements,
glEdgeFlagPointer,
glGetPointerv,
glIndexPointer,
glInterleavedArrays,
glNormalPointer,
glTexCoordPointer,
glVertexPointer