1GLCOLORPOINTER(3G) OpenGL Manual GLCOLORPOINTER(3G)
2
3
4
6 glColorPointer - define an array of colors
7
9 void glColorPointer(GLint size, GLenum type, GLsizei stride,
10 const GLvoid * pointer);
11
13 size
14 Specifies the number of components per color. Must be 3 or 4. The
15 initial value is 4.
16
17 type
18 Specifies the data type of each color component in the array.
19 Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT,
20 GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, and GL_DOUBLE
21 are accepted. The initial value is GL_FLOAT.
22
23 stride
24 Specifies the byte offset between consecutive colors. If stride is
25 0, the colors are understood to be tightly packed in the array. The
26 initial value is 0.
27
28 pointer
29 Specifies a pointer to the first component of the first color
30 element in the array. The initial value is 0.
31
33 glColorPointer specifies the location and data format of an array of
34 color components to use when rendering. size specifies the number of
35 components per color, and must be 3 or 4. type specifies the data type
36 of each color component, and stride specifies the byte stride from one
37 color to the next, allowing vertices and attributes to be packed into a
38 single array or stored in separate arrays. (Single-array storage may be
39 more efficient on some implementations; see glInterleavedArrays().)
40
41 If a non-zero named buffer object is bound to the GL_ARRAY_BUFFER
42 target (see glBindBuffer()) while a color array is specified, pointer
43 is treated as a byte offset into the buffer object's data store. Also,
44 the buffer object binding (GL_ARRAY_BUFFER_BINDING) is saved as color
45 vertex array client-side state (GL_COLOR_ARRAY_BUFFER_BINDING).
46
47 When a color array is specified, size, type, stride, and pointer are
48 saved as client-side state, in addition to the current vertex array
49 buffer object binding.
50
51 To enable and disable the color array, call glEnableClientState() and
52 glDisableClientState() with the argument GL_COLOR_ARRAY. If enabled,
53 the color array is used when glDrawArrays(), glMultiDrawArrays(),
54 glDrawElements(), glMultiDrawElements(), glDrawRangeElements(), or
55 glArrayElement() is called.
56
58 glColorPointer is available only if the GL version is 1.1 or greater.
59
60 The color array is initially disabled and isn't accessed when
61 glArrayElement(), glDrawElements(), glDrawRangeElements(),
62 glDrawArrays(), glMultiDrawArrays(), or glMultiDrawElements() is
63 called.
64
65 Execution of glColorPointer is not allowed between the execution of
66 glBegin() and the corresponding execution of glEnd(), but an error may
67 or may not be generated. If no error is generated, the operation is
68 undefined.
69
70 glColorPointer is typically implemented on the client side.
71
72 Color array parameters are client-side state and are therefore not
73 saved or restored by glPushAttrib() and glPopAttrib(). Use
74 glPushClientAttrib() and glPopClientAttrib() instead.
75
77 GL_INVALID_VALUE is generated if size is not 3 or 4.
78
79 GL_INVALID_ENUM is generated if type is not an accepted value.
80
81 GL_INVALID_VALUE is generated if stride is negative.
82
84 glIsEnabled() with argument GL_COLOR_ARRAY
85
86 glGet() with argument GL_COLOR_ARRAY_SIZE
87
88 glGet() with argument GL_COLOR_ARRAY_TYPE
89
90 glGet() with argument GL_COLOR_ARRAY_STRIDE
91
92 glGet() with argument GL_COLOR_ARRAY_BUFFER_BINDING
93
94 glGet() with argument GL_ARRAY_BUFFER_BINDING
95
96 glGetPointerv() with argument GL_COLOR_ARRAY_POINTER
97
99 glArrayElement(), glBindBuffer(), glColor(), glDisableClientState(),
100 glDrawArrays(), glDrawElements(), glDrawRangeElements(),
101 glEdgeFlagPointer(), glEnableClientState(), glFogCoordPointer(),
102 glIndexPointer(), glInterleavedArrays(), glMultiDrawArrays(),
103 glMultiDrawElements(), glNormalPointer(), glPopClientAttrib(),
104 glPushClientAttrib(), glSecondaryColorPointer(), glTexCoordPointer(),
105 glVertexAttribPointer(), glVertexPointer()
106
108 Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
109 under the SGI Free Software B License. For details, see
110 http://oss.sgi.com/projects/FreeB/.
111
113 opengl.org
114
115
116
117opengl.org 06/10/2014 GLCOLORPOINTER(3G)