Commit | Line | Data |
---|---|---|
7faf1d71 AW |
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"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>1991-2006</year> | |
9 | <holder>Silicon Graphics, Inc.</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glVertexPointer</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glVertexPointer</refname> | |
17 | <refpurpose>define an array of vertex data</refpurpose> | |
18 | </refnamediv> | |
19 | <refsynopsisdiv><title>C Specification</title> | |
20 | <funcsynopsis> | |
21 | <funcprototype> | |
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> | |
27 | </funcprototype> | |
28 | </funcsynopsis> | |
29 | </refsynopsisdiv> | |
30 | <!-- eqn: ignoring delim $$ --> | |
31 | <refsect1 id="parameters"><title>Parameters</title> | |
32 | <variablelist> | |
33 | <varlistentry> | |
34 | <term><parameter>size</parameter></term> | |
35 | <listitem> | |
36 | <para> | |
37 | Specifies the number of coordinates per vertex. Must be 2, 3, or | |
38 | 4. The initial value is 4. | |
39 | </para> | |
40 | </listitem> | |
41 | </varlistentry> | |
42 | <varlistentry> | |
43 | <term><parameter>type</parameter></term> | |
44 | <listitem> | |
45 | <para> | |
46 | Specifies the data type of each coordinate in the array. | |
47 | Symbolic constants | |
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>. | |
53 | </para> | |
54 | </listitem> | |
55 | </varlistentry> | |
56 | <varlistentry> | |
57 | <term><parameter>stride</parameter></term> | |
58 | <listitem> | |
59 | <para> | |
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 | |
63 | is 0. | |
64 | </para> | |
65 | </listitem> | |
66 | </varlistentry> | |
67 | <varlistentry> | |
68 | <term><parameter>pointer</parameter></term> | |
69 | <listitem> | |
70 | <para> | |
71 | Specifies a pointer to the first coordinate of the first vertex in the | |
72 | array. The initial value is 0. | |
73 | </para> | |
74 | </listitem> | |
75 | </varlistentry> | |
76 | </variablelist> | |
77 | </refsect1> | |
78 | <refsect1 id="description"><title>Description</title> | |
79 | <para> | |
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>.) | |
88 | </para> | |
89 | <para> | |
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>). | |
95 | </para> | |
96 | <para> | |
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. | |
100 | </para> | |
101 | <para> | |
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> | |
107 | is called. | |
108 | </para> | |
109 | </refsect1> | |
110 | <refsect1 id="notes"><title>Notes</title> | |
111 | <para> | |
112 | <function>glVertexPointer</function> is available only if the GL version is 1.1 or greater. | |
113 | </para> | |
114 | <para> | |
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> | |
118 | is called. | |
119 | </para> | |
120 | <para> | |
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. | |
125 | </para> | |
126 | <para> | |
127 | <function>glVertexPointer</function> is typically implemented on the client side. | |
128 | </para> | |
129 | <para> | |
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. | |
133 | </para> | |
134 | </refsect1> | |
135 | <refsect1 id="errors"><title>Errors</title> | |
136 | <para> | |
137 | <constant>GL_INVALID_VALUE</constant> is generated if <parameter>size</parameter> is not 2, 3, or 4. | |
138 | </para> | |
139 | <para> | |
140 | <constant>GL_INVALID_ENUM</constant> is generated if <parameter>type</parameter> is not an accepted value. | |
141 | </para> | |
142 | <para> | |
143 | <constant>GL_INVALID_VALUE</constant> is generated if <parameter>stride</parameter> is negative. | |
144 | </para> | |
145 | </refsect1> | |
146 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
147 | <para> | |
148 | <citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_VERTEX_ARRAY</constant> | |
149 | </para> | |
150 | <para> | |
151 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_VERTEX_ARRAY_SIZE</constant> | |
152 | </para> | |
153 | <para> | |
154 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_VERTEX_ARRAY_TYPE</constant> | |
155 | </para> | |
156 | <para> | |
157 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_VERTEX_ARRAY_STRIDE</constant> | |
158 | </para> | |
159 | <para> | |
160 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_VERTEX_ARRAY_BUFFER_BINDING</constant> | |
161 | </para> | |
162 | <para> | |
163 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_ARRAY_BUFFER_BINDING</constant> | |
164 | </para> | |
165 | <para> | |
166 | <citerefentry><refentrytitle>glGetPointerv</refentrytitle></citerefentry> with argument <constant>GL_VERTEX_ARRAY_POINTER</constant> | |
167 | </para> | |
168 | </refsect1> | |
169 | <refsect1 id="seealso"><title>See Also</title> | |
170 | <para> | |
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> | |
192 | </para> | |
193 | </refsect1> | |
194 | <refsect1 id="Copyright"><title>Copyright</title> | |
195 | <para> | |
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>. | |
200 | </para> | |
201 | </refsect1> | |
202 | </refentry> |