1GLVERTEXPOINTER(3G) GLVERTEXPOINTER(3G)
2
3
4
6 glVertexPointer - define an array of vertex data
7
8
10 void glVertexPointer( GLint size,
11 GLenum type,
12 GLsizei stride,
13 const GLvoid *ptr )
14
15
17 size Specifies the number of coordinates per vertex; must be 2, 3,
18 or 4. The initial value is 4.
19
20 type Specifies the data type of each coordinate in the array. Sym‐
21 bolic constants GL_SHORT, GL_INT, GL_FLOAT, and GL_DOUBLE are
22 accepted. The initial value is GL_FLOAT.
23
24 stride Specifies the byte offset between consecutive vertices. If
25 stride is 0, the vertices are understood to be tightly packed
26 in the array. The initial value is 0.
27
28 ptr Specifies a pointer to the first coordinate of the first vertex
29 in the array. The initial value is 0.
30
32 glVertexPointer specifies the location and data of an array of vertex
33 coordinates to use when rendering. size specifies the number of coor‐
34 dinates per vertex and type the data type of the coordinates. stride
35 specifies the byte stride from one vertex to the next allowing vertices
36 and attributes to be packed into a single array or stored in separate
37 arrays. (Single-array storage may be more efficient on some implemen‐
38 tations; see glInterleavedArrays.) When a vertex array is specified,
39 size, type, stride, and ptr are saved as client-side state.
40
41 To enable and disable the vertex array, call glEnableClientState and
42 glDisableClientState with the argument GL_VERTEX_ARRAY. If enabled, the
43 vertex array is used when glDrawArrays, glDrawElements, or
44 glArrayElement is called.
45
46 Use glDrawArrays to construct a sequence of primitives (all of the same
47 type) from prespecified vertex and vertex attribute arrays. Use
48 glArrayElement to specify primitives by indexing vertices and vertex
49 attributes and glDrawElements to construct a sequence of primitives by
50 indexing vertices and vertex attributes.
51
53 glVertexPointer is available only if the GL version is 1.1 or greater.
54
55 The vertex array is initially disabled and isn't accessed when
56 glArrayElement, glDrawElements or glDrawArrays is called.
57
58 Execution of glVertexPointer is not allowed between the execution of
59 glBegin and the corresponding execution of glEnd, but an error may or
60 may not be generated. If no error is generated, the operation is unde‐
61 fined.
62
63 glVertexPointer is typically implemented on the client side.
64
65 Vertex array parameters are client-side state and are therefore not
66 saved or restored by glPushAttrib and glPopAttrib. Use
67 glPushClientAttrib and glPopClientAttrib instead.
68
70 GL_INVALID_VALUE is generated if size is not 2, 3, or 4.
71
72 GL_INVALID_ENUM is generated if type is is not an accepted value.
73
74 GL_INVALID_VALUE is generated if stride is negative.
75
77 glIsEnabled with argument GL_VERTEX_ARRAY
78 glGet with argument GL_VERTEX_ARRAY_SIZE
79 glGet with argument GL_VERTEX_ARRAY_TYPE
80 glGet with argument GL_VERTEX_ARRAY_STRIDE
81 glGetPointerv with argument GL_VERTEX_ARRAY_POINTER
82
84 glArrayElement(3G), glColorPointer(3G), glDrawArrays(3G),
85 glDrawElements(3G), glDrawRangeElements(3G), glEdgeFlagPointer(3G),
86 glEnable(3G), glGetPointerv(3G), glIndexPointer(3G),
87 glInterleavedArrays(3G), glNormalPointer(3G), glPopClientAttrib(3G),
88 glPushClientAttrib(3G), glTexCoordPointer(3G)
89
90
91
92 GLVERTEXPOINTER(3G)