NAME
glColorPointer
- define an array of colors
C SPECIFICATION
void ggllCCoolloorrPPooiinntteerr(
GLint _s_i_z_e,
GLenum _t_y_p_e,
GLsizei _s_t_r_i_d_e,
const GLvoid _*_p_t_r )
delim $$
PARAMETERS
-
_s_i_z_e
-
Specifies the number of components per color. Must be 3 or 4.
The initial value is 4.
-
_t_y_p_e
-
Specifies the data type of each color component in the array.
Symbolic constants
GGLL__BBYYTTEE,
GGLL__UUNNSSIIGGNNEEDD__BBYYTTEE,
GGLL__SSHHOORRTT,
GGLL__UUNNSSIIGGNNEEDD__SSHHOORRTT,
GGLL__IINNTT,
GGLL__UUNNSSIIGGNNEEDD__IINNTT,
GGLL__FFLLOOAATT,
and
GGLL__DDOOUUBBLLEE
are accepted.
The initial value is GGLL__FFLLOOAATT.
-
_s_t_r_i_d_e
-
Specifies the byte offset between consecutive colors.
If _s_t_r_i_d_e is 0 (the initial value), the colors are understood to be
tightly packed in the array. The initial value is 0.
-
_p_t_r
-
Specifies a pointer to the first component of the first color element
in the array.
DESCRIPTION
ggllCCoolloorrPPooiinntteerr specifies the location and data of an array of color components
to use when rendering.
_s_i_z_e specifies the number of components per color, and must be 3 or 4.
_t_y_p_e specifies the data type of each color component, and _s_t_r_i_d_e
specifies the byte stride from one color to the next allowing vertices and
attributes to be packed into a single array or stored in separate arrays.
(Single-array storage may be more efficient on some implementations;
see ggllIInntteerrlleeaavveeddAArrrraayyss.)
When a color array is specified,
_s_i_z_e, _t_y_p_e, _s_t_r_i_d_e, and _p_t_r are saved as client-side
state.
To enable and disable the color array, call ggllEEnnaabblleeCClliieennttSSttaattee and
ggllDDiissaabblleeCClliieennttSSttaattee with the argument GGLL__CCOOLLOORR__AARRRRAAYY. If
enabled, the color array is used when ggllDDrraawwAArrrraayyss,
ggllDDrraawwEElleemmeennttss, ggllDDrraawwRRaannggeeEElleemmeennttss, or ggllAArrrraayyEElleemmeenntt is
called.
NOTES
ggllCCoolloorrPPooiinntteerr is available only if the GL version is 1.1 or greater.
The color array is initially disabled and isn't accessed when
ggllAArrrraayyEElleemmeenntt, ggllDDrraawwAArrrraayyss, ggllDDrraawwRRaannggeeEElleemmeennttss,
or ggllDDrraawwEElleemmeennttss is called.
Execution of ggllCCoolloorrPPooiinntteerr is not allowed between the execution of
ggllBBeeggiinn and the corresponding execution of ggllEEnndd,
but an error may or may not be generated. If no error is generated,
the operation is undefined.
ggllCCoolloorrPPooiinntteerr is typically implemented on the client side.
Color array parameters are client-side state and are therefore not saved
or restored by ggllPPuusshhAAttttrriibb and ggllPPooppAAttttrriibb.
Use ggllPPuusshhCClliieennttAAttttrriibb and ggllPPooppCClliieennttAAttttrriibb instead.
ERRORS
GGLL__IINNVVAALLIIDD__VVAALLUUEE is generated if _s_i_z_e is not 3 or 4.
GGLL__IINNVVAALLIIDD__EENNUUMM is generated if _t_y_p_e is not an accepted value.
GGLL__IINNVVAALLIIDD__VVAALLUUEE is generated if _s_t_r_i_d_e is negative.
ASSOCIATED GETS
ggllIIssEEnnaabblleedd with argument GGLL__CCOOLLOORR__AARRRRAAYY
ggllGGeett with argument GGLL__CCOOLLOORR__AARRRRAAYY__SSIIZZEE
ggllGGeett with argument GGLL__CCOOLLOORR__AARRRRAAYY__TTYYPPEE
ggllGGeett with argument GGLL__CCOOLLOORR__AARRRRAAYY__SSTTRRIIDDEE
ggllGGeettPPooiinntteerrvv with argument GGLL__CCOOLLOORR__AARRRRAAYY__PPOOIINNTTEERR
SEE ALSO
ggllAArrrraayyEElleemmeenntt((33GG)),
ggllDDrraawwAArrrraayyss((33GG)),
ggllDDrraawwEElleemmeennttss((33GG)),
ggllEEddggeeFFllaaggPPooiinntteerr((33GG)),
ggllEEnnaabbllee((33GG)),
ggllGGeettPPooiinntteerrvv((33GG)),
ggllIInnddeexxPPooiinntteerr((33GG)),
ggllIInntteerrlleeaavveeddAArrrraayyss((33GG)),
ggllNNoorrmmaallPPooiinntteerr((33GG)),
ggllPPooppCClliieennttAAttttrriibb((33GG)),
ggllPPuusshhCClliieennttAAttttrriibb((33GG)),
ggllTTeexxCCoooorrddPPooiinntteerr((33GG)),
ggllVVeerrtteexxPPooiinntteerr((33GG))