glColorPointer.3   [plain text]


'\" te  
'\"macro stdmacro
.ds Vn Version 1.2
.ds Dt 24 September 1999
.ds Re Release 1.2.1
.ds Dp May 22 14:44
.ds Dm 2 May 22 14:
.ds Xs 01769     6
.TH GLCOLORPOINTER 3G
.SH NAME
.B "glColorPointer
\- define an array of colors

.SH C SPECIFICATION
void \f3glColorPointer\fP(
GLint \fIsize\fP,
.nf
.ta \w'\f3void \fPglColorPointer( 'u
	GLenum \fItype\fP,
	GLsizei \fIstride\fP,
	const GLvoid \fI*pointer\fP )
.fi

.EQ
delim $$
.EN
.SH PARAMETERS
.TP \w'\fIpointer\fP\ \ 'u 
\f2size\fP
Specifies the number of components per color. Must be 3 or 4.
The initial value is 4.
.TP
\f2type\fP
Specifies the data type of each color component in the array.
Symbolic constants
\%\f3GL_BYTE\fP,
\%\f3GL_UNSIGNED_BYTE\fP,
\%\f3GL_SHORT\fP,
\%\f3GL_UNSIGNED_SHORT\fP,
\%\f3GL_INT\fP,
\%\f3GL_UNSIGNED_INT\fP,
\%\f3GL_FLOAT\fP,
and
\%\f3GL_DOUBLE\fP
are accepted. 
The initial value is \%\f3GL_FLOAT\fP.
.TP
\f2stride\fP
Specifies the byte offset between consecutive colors.
If \f2stride\fP is 0 (the initial value), the colors are understood to be
tightly packed in the array. The initial value is 0.
.TP
\f2pointer\fP
Specifies a pointer to the first component of the first color element
in the array.
.SH DESCRIPTION
\%\f3glColorPointer\fP specifies the location and data  of an array of color components
to use when rendering.
\f2size\fP specifies the number of components per color, and must be 3 or 4.
\f2type\fP specifies the data type of each color component, and \f2stride\fP
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 \%\f3glInterleavedArrays\fP.)
.P
When a color array is specified, 
\f2size\fP, \f2type\fP, \f2stride\fP, and \f2pointer\fP are saved as client-side
state.
.P
To enable and disable the color array, call \%\f3glEnableClientState\fP and
.br
\%\f3glDisableClientState\fP with the argument \%\f3GL_COLOR_ARRAY\fP. If
enabled, the color array is used when \%\f3glDrawArrays\fP,
\%\f3glDrawElements\fP, \%\f3glDrawRangeElements\fP, or \%\f3glArrayElement\fP is
called. 
.SH NOTES
\%\f3glColorPointer\fP is available only if the GL version is 1.1 or greater.
.P
The color array is initially disabled and isn't accessed when
\%\f3glArrayElement\fP, \%\f3glDrawArrays\fP, \%\f3glDrawRangeElements\fP, 
or \%\f3glDrawElements\fP is called.
.P
Execution of \%\f3glColorPointer\fP is not allowed between the execution of
\%\f3glBegin\fP and the corresponding execution of \%\f3glEnd\fP,
but an error may or may not be generated. If no error is generated,
the operation is undefined.
.P
\%\f3glColorPointer\fP is typically implemented on the client side.
.P
Color array parameters are client-side state and are therefore not saved 
or restored by \%\f3glPushAttrib\fP and \%\f3glPopAttrib\fP.
Use \%\f3glPushClientAttrib\fP and \%\f3glPopClientAttrib\fP instead.
.SH ERRORS
\%\f3GL_INVALID_VALUE\fP is generated if \f2size\fP is not 3 or 4.
.P
\%\f3GL_INVALID_ENUM\fP is generated if \f2type\fP is not an accepted value.
.P
\%\f3GL_INVALID_VALUE\fP is generated if \f2stride\fP is negative.
.SH ASSOCIATED GETS  
\%\f3glIsEnabled\fP with argument \%\f3GL_COLOR_ARRAY\fP
.br
\%\f3glGet\fP with argument \%\f3GL_COLOR_ARRAY_SIZE\fP
.br
\%\f3glGet\fP with argument \%\f3GL_COLOR_ARRAY_TYPE\fP
.br
\%\f3glGet\fP with argument \%\f3GL_COLOR_ARRAY_STRIDE\fP
.br
\%\f3glGetPointerv\fP with argument \%\f3GL_COLOR_ARRAY_POINTER\fP
.SH SEE ALSO 
\%\f3glArrayElement\fP,
\%\f3glDrawArrays\fP,
\%\f3glDrawElements\fP,
\%\f3glEdgeFlagPointer\fP,
\%\f3glEnable\fP,
\%\f3glGetPointerv\fP,
\%\f3glIndexPointer\fP,
\%\f3glInterleavedArrays\fP,
\%\f3glNormalPointer\fP,
\%\f3glPopClientAttrib\fP,
\%\f3glPushClientAttrib\fP,
\%\f3glTexCoordPointer\fP,
\%\f3glVertexPointer\fP