1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id=
"glVertexPointer">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glVertexPointer
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glVertexPointer
</refname>
17 <refpurpose>define an array of vertex data
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glVertexPointer
</function></funcdef>
23 <paramdef>GLint
<parameter>size
</parameter></paramdef>
24 <paramdef>GLenum
<parameter>type
</parameter></paramdef>
25 <paramdef>GLsizei
<parameter>stride
</parameter></paramdef>
26 <paramdef>const GLvoid *
<parameter>pointer
</parameter></paramdef>
30 <!-- eqn: ignoring delim $$ -->
31 <refsect1 id=
"parameters"><title>Parameters
</title>
34 <term><parameter>size
</parameter></term>
37 Specifies the number of coordinates per vertex. Must be
2,
3, or
38 4. The initial value is
4.
43 <term><parameter>type
</parameter></term>
46 Specifies the data type of each coordinate in the array.
48 <constant>GL_SHORT
</constant>,
49 <constant>GL_INT
</constant>,
50 <constant>GL_FLOAT
</constant>,
51 or
<constant>GL_DOUBLE
</constant>
52 are accepted. The initial value is
<constant>GL_FLOAT
</constant>.
57 <term><parameter>stride
</parameter></term>
60 Specifies the byte offset between consecutive
61 vertices. If
<parameter>stride
</parameter> is
0, the vertices are understood to be tightly packed in
62 the array. The initial value
68 <term><parameter>pointer
</parameter></term>
71 Specifies a pointer to the first coordinate of the first vertex in the
72 array. The initial value is
0.
78 <refsect1 id=
"description"><title>Description
</title>
80 <function>glVertexPointer
</function> specifies the location and data format of an array of vertex coordinates
81 to use when rendering.
82 <parameter>size
</parameter> specifies the number of coordinates per vertex, and must be
2,
3, or
4.
83 <parameter>type
</parameter> specifies the data type of each coordinate, and
<parameter>stride
</parameter> specifies the byte stride from one
84 vertex to the next, allowing vertices and attributes
85 to be packed into a single array or stored in separate arrays.
86 (Single-array storage may be more efficient on some implementations;
87 see
<citerefentry><refentrytitle>glInterleavedArrays
</refentrytitle></citerefentry>.)
90 If a non-zero named buffer object is bound to the
<constant>GL_ARRAY_BUFFER
</constant> target
91 (see
<citerefentry><refentrytitle>glBindBuffer
</refentrytitle></citerefentry>) while a vertex array is
92 specified,
<parameter>pointer
</parameter> is treated as a byte offset into the buffer object's data store.
93 Also, the buffer object binding (
<constant>GL_ARRAY_BUFFER_BINDING
</constant>) is saved as vertex array
94 client-side state (
<constant>GL_VERTEX_ARRAY_BUFFER_BINDING
</constant>).
97 When a vertex array is specified,
98 <parameter>size
</parameter>,
<parameter>type
</parameter>,
<parameter>stride
</parameter>, and
<parameter>pointer
</parameter> are saved as client-side
99 state, in addition to the current vertex array buffer object binding.
102 To enable and disable the vertex array, call
<citerefentry><refentrytitle>glEnableClientState
</refentrytitle></citerefentry> and
103 <citerefentry><refentrytitle>glDisableClientState
</refentrytitle></citerefentry> with the argument
<constant>GL_VERTEX_ARRAY
</constant>. If
104 enabled, the vertex array is used when
105 <citerefentry><refentrytitle>glArrayElement
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawArrays
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMultiDrawArrays
</refentrytitle></citerefentry>,
106 <citerefentry><refentrytitle>glDrawElements
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMultiDrawElements
</refentrytitle></citerefentry>, or
<citerefentry><refentrytitle>glDrawRangeElements
</refentrytitle></citerefentry>
110 <refsect1 id=
"notes"><title>Notes
</title>
112 <function>glVertexPointer
</function> is available only if the GL version is
1.1 or greater.
115 The vertex array is initially disabled and isn't accessed when
116 <citerefentry><refentrytitle>glArrayElement
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElements
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElements
</refentrytitle></citerefentry>,
117 <citerefentry><refentrytitle>glDrawArrays
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMultiDrawArrays
</refentrytitle></citerefentry>, or
<citerefentry><refentrytitle>glMultiDrawElements
</refentrytitle></citerefentry>
121 Execution of
<function>glVertexPointer
</function> is not allowed between the execution of
122 <citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry> and the corresponding execution of
<citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>,
123 but an error may or may not be generated. If no error is generated,
124 the operation is undefined.
127 <function>glVertexPointer
</function> is typically implemented on the client side.
130 Vertex array parameters are client-side state and are therefore not
131 saved or restored by
<citerefentry><refentrytitle>glPushAttrib
</refentrytitle></citerefentry> and
<citerefentry><refentrytitle>glPopAttrib
</refentrytitle></citerefentry>.
132 Use
<citerefentry><refentrytitle>glPushClientAttrib
</refentrytitle></citerefentry> and
<citerefentry><refentrytitle>glPopClientAttrib
</refentrytitle></citerefentry> instead.
135 <refsect1 id=
"errors"><title>Errors
</title>
137 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>size
</parameter> is not
2,
3, or
4.
140 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>type
</parameter> is not an accepted value.
143 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>stride
</parameter> is negative.
146 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
148 <citerefentry><refentrytitle>glIsEnabled
</refentrytitle></citerefentry> with argument
<constant>GL_VERTEX_ARRAY
</constant>
151 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_VERTEX_ARRAY_SIZE
</constant>
154 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_VERTEX_ARRAY_TYPE
</constant>
157 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_VERTEX_ARRAY_STRIDE
</constant>
160 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_VERTEX_ARRAY_BUFFER_BINDING
</constant>
163 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_ARRAY_BUFFER_BINDING
</constant>
166 <citerefentry><refentrytitle>glGetPointerv
</refentrytitle></citerefentry> with argument
<constant>GL_VERTEX_ARRAY_POINTER
</constant>
169 <refsect1 id=
"seealso"><title>See Also
</title>
171 <citerefentry><refentrytitle>glArrayElement
</refentrytitle></citerefentry>,
172 <citerefentry><refentrytitle>glBindBuffer
</refentrytitle></citerefentry>,
173 <citerefentry><refentrytitle>glColorPointer
</refentrytitle></citerefentry>,
174 <citerefentry><refentrytitle>glDisableClientState
</refentrytitle></citerefentry>,
175 <citerefentry><refentrytitle>glDrawArrays
</refentrytitle></citerefentry>,
176 <citerefentry><refentrytitle>glDrawElements
</refentrytitle></citerefentry>,
177 <citerefentry><refentrytitle>glDrawRangeElements
</refentrytitle></citerefentry>,
178 <citerefentry><refentrytitle>glEdgeFlagPointer
</refentrytitle></citerefentry>,
179 <citerefentry><refentrytitle>glEnableClientState
</refentrytitle></citerefentry>,
180 <citerefentry><refentrytitle>glFogCoordPointer
</refentrytitle></citerefentry>,
181 <citerefentry><refentrytitle>glIndexPointer
</refentrytitle></citerefentry>,
182 <citerefentry><refentrytitle>glInterleavedArrays
</refentrytitle></citerefentry>,
183 <citerefentry><refentrytitle>glMultiDrawArrays
</refentrytitle></citerefentry>,
184 <citerefentry><refentrytitle>glMultiDrawElements
</refentrytitle></citerefentry>,
185 <citerefentry><refentrytitle>glNormalPointer
</refentrytitle></citerefentry>,
186 <citerefentry><refentrytitle>glPopClientAttrib
</refentrytitle></citerefentry>,
187 <citerefentry><refentrytitle>glPushClientAttrib
</refentrytitle></citerefentry>,
188 <citerefentry><refentrytitle>glSecondaryColorPointer
</refentrytitle></citerefentry>,
189 <citerefentry><refentrytitle>glTexCoordPointer
</refentrytitle></citerefentry>,
190 <citerefentry><refentrytitle>glVertex
</refentrytitle></citerefentry>,
191 <citerefentry><refentrytitle>glVertexAttribPointer
</refentrytitle></citerefentry>
194 <refsect1 id=
"Copyright"><title>Copyright
</title>
196 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
197 Silicon Graphics, Inc. This document is licensed under the SGI
198 Free Software B License. For details, see
199 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.