NAME
glDrawElements
- render primitives from array data
C SPECIFICATION
void ggllDDrraawwEElleemmeennttss(
GLenum _m_o_d_e,
GLsizei _c_o_u_n_t,
GLenum _t_y_p_e,
const GLvoid _*_i_n_d_i_c_e_s )
delim $$
PARAMETERS
-
_m_o_d_e
-
Specifies what kind of primitives to render.
Symbolic constants
GGLL__PPOOIINNTTSS,
GGLL__LLIINNEE__SSTTRRIIPP,
GGLL__LLIINNEE__LLOOOOPP,
GGLL__LLIINNEESS,
GGLL__TTRRIIAANNGGLLEE__SSTTRRIIPP,
GGLL__TTRRIIAANNGGLLEE__FFAANN,
GGLL__TTRRIIAANNGGLLEESS,
GGLL__QQUUAADD__SSTTRRIIPP,
GGLL__QQUUAADDSS,
and GGLL__PPOOLLYYGGOONN are accepted.
-
_c_o_u_n_t
-
Specifies the number of elements to be rendered.
-
_t_y_p_e
-
Specifies the type of the values in _i_n_d_i_c_e_s. Must be one of
GGLL__UUNNSSIIGGNNEEDD__BBYYTTEE, GGLL__UUNNSSIIGGNNEEDD__SSHHOORRTT, or
GGLL__UUNNSSIIGGNNEEDD__IINNTT.
-
_i_n_d_i_c_e_s
-
Specifies a pointer to the location where the indices are stored.
DESCRIPTION
ggllDDrraawwEElleemmeennttss 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 vertices, normals, and so on and use them to
construct a sequence of primitives with a single
call to ggllDDrraawwEElleemmeennttss.
When ggllDDrraawwEElleemmeennttss is called, it uses _c_o_u_n_t sequential elements from an
enabled array, starting at _i_n_d_i_c_e_s to construct a sequence of
geometric primitives. _m_o_d_e 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
GGLL__VVEERRTTEEXX__AARRRRAAYY is not enabled, no geometric primitives are
constructed.
Vertex attributes that are modified by ggllDDrraawwEElleemmeennttss have an
unspecified value after ggllDDrraawwEElleemmeennttss returns. For example, if
GGLL__CCOOLLOORR__AARRRRAAYY is enabled, the value of the current color is
undefined after ggllDDrraawwEElleemmeennttss executes. Attributes that aren't
modified maintain their previous values.
NOTES
ggllDDrraawwEElleemmeennttss is available only if the GL version is 1.1 or greater.
ggllDDrraawwEElleemmeennttss is included in display lists. If ggllDDrraawwEElleemmeennttss 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.
ERRORS
GGLL__IINNVVAALLIIDD__EENNUUMM is generated if _m_o_d_e is not an accepted value.
GGLL__IINNVVAALLIIDD__VVAALLUUEE is generated if _c_o_u_n_t is negative.
GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if ggllDDrraawwEElleemmeennttss is executed between
the execution of ggllBBeeggiinn and the corresponding ggllEEnndd.
SEE ALSO
ggllAArrrraayyEElleemmeenntt((33GG)),
ggllCCoolloorrPPooiinntteerr((33GG)),
ggllDDrraawwAArrrraayyss((33GG)),
ggllDDrraawwRRaannggeeEElleemmeennttss((33GG)),
ggllEEddggeeFFllaaggPPooiinntteerr((33GG)),
ggllGGeettPPooiinntteerrvv((33GG)),
ggllIInnddeexxPPooiinntteerr((33GG)),
ggllIInntteerrlleeaavveeddAArrrraayyss((33GG)),
ggllNNoorrmmaallPPooiinntteerr((33GG)),
ggllTTeexxCCoooorrddPPooiinntteerr((33GG)),
ggllVVeerrtteexxPPooiinntteerr((33GG))