rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man3 / glVertexAttrib.xml
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="glVertexAttrib">
5 <refmeta>
6 <refentrytitle>glVertexAttrib</refentrytitle>
7 <manvolnum>3G</manvolnum>
8 </refmeta>
9 <refnamediv>
10 <refname>glVertexAttrib</refname>
11 <refpurpose>Specifies the value of a generic vertex attribute</refpurpose>
12 </refnamediv>
13 <refsynopsisdiv><title>C Specification</title>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>void <function>glVertexAttrib1f</function></funcdef>
17 <paramdef>GLuint <parameter>index</parameter></paramdef>
18 <paramdef>GLfloat <parameter>v0</parameter></paramdef>
19 </funcprototype>
20 <funcprototype>
21 <funcdef>void <function>glVertexAttrib1s</function></funcdef>
22 <paramdef>GLuint <parameter>index</parameter></paramdef>
23 <paramdef>GLshort <parameter>v0</parameter></paramdef>
24 </funcprototype>
25 <funcprototype>
26 <funcdef>void <function>glVertexAttrib1d</function></funcdef>
27 <paramdef>GLuint <parameter>index</parameter></paramdef>
28 <paramdef>GLdouble <parameter>v0</parameter></paramdef>
29 </funcprototype>
30 <funcprototype>
31 <funcdef>void <function>glVertexAttribI1i</function></funcdef>
32 <paramdef>GLuint <parameter>index</parameter></paramdef>
33 <paramdef>GLint <parameter>v0</parameter></paramdef>
34 </funcprototype>
35 <funcprototype>
36 <funcdef>void <function>glVertexAttribI1ui</function></funcdef>
37 <paramdef>GLuint <parameter>index</parameter></paramdef>
38 <paramdef>GLuint <parameter>v0</parameter></paramdef>
39 </funcprototype>
40 <funcprototype>
41 <funcdef>void <function>glVertexAttrib2f</function></funcdef>
42 <paramdef>GLuint <parameter>index</parameter></paramdef>
43 <paramdef>GLfloat <parameter>v0</parameter></paramdef>
44 <paramdef>GLfloat <parameter>v1</parameter></paramdef>
45 </funcprototype>
46 <funcprototype>
47 <funcdef>void <function>glVertexAttrib2s</function></funcdef>
48 <paramdef>GLuint <parameter>index</parameter></paramdef>
49 <paramdef>GLshort <parameter>v0</parameter></paramdef>
50 <paramdef>GLshort <parameter>v1</parameter></paramdef>
51 </funcprototype>
52 <funcprototype>
53 <funcdef>void <function>glVertexAttrib2d</function></funcdef>
54 <paramdef>GLuint <parameter>index</parameter></paramdef>
55 <paramdef>GLdouble <parameter>v0</parameter></paramdef>
56 <paramdef>GLdouble <parameter>v1</parameter></paramdef>
57 </funcprototype>
58 <funcprototype>
59 <funcdef>void <function>glVertexAttribI2i</function></funcdef>
60 <paramdef>GLuint <parameter>index</parameter></paramdef>
61 <paramdef>GLint <parameter>v0</parameter></paramdef>
62 <paramdef>GLint <parameter>v1</parameter></paramdef>
63 </funcprototype>
64 <funcprototype>
65 <funcdef>void <function>glVertexAttribI2ui</function></funcdef>
66 <paramdef>GLuint <parameter>index</parameter></paramdef>
67 <paramdef>GLuint <parameter>v0</parameter></paramdef>
68 <paramdef>GLuint <parameter>v1</parameter></paramdef>
69 </funcprototype>
70 <funcprototype>
71 <funcdef>void <function>glVertexAttrib3f</function></funcdef>
72 <paramdef>GLuint <parameter>index</parameter></paramdef>
73 <paramdef>GLfloat <parameter>v0</parameter></paramdef>
74 <paramdef>GLfloat <parameter>v1</parameter></paramdef>
75 <paramdef>GLfloat <parameter>v2</parameter></paramdef>
76 </funcprototype>
77 <funcprototype>
78 <funcdef>void <function>glVertexAttrib3s</function></funcdef>
79 <paramdef>GLuint <parameter>index</parameter></paramdef>
80 <paramdef>GLshort <parameter>v0</parameter></paramdef>
81 <paramdef>GLshort <parameter>v1</parameter></paramdef>
82 <paramdef>GLshort <parameter>v2</parameter></paramdef>
83 </funcprototype>
84 <funcprototype>
85 <funcdef>void <function>glVertexAttrib3d</function></funcdef>
86 <paramdef>GLuint <parameter>index</parameter></paramdef>
87 <paramdef>GLdouble <parameter>v0</parameter></paramdef>
88 <paramdef>GLdouble <parameter>v1</parameter></paramdef>
89 <paramdef>GLdouble <parameter>v2</parameter></paramdef>
90 </funcprototype>
91 <funcprototype>
92 <funcdef>void <function>glVertexAttribI3i</function></funcdef>
93 <paramdef>GLuint <parameter>index</parameter></paramdef>
94 <paramdef>GLint <parameter>v0</parameter></paramdef>
95 <paramdef>GLint <parameter>v1</parameter></paramdef>
96 <paramdef>GLint <parameter>v2</parameter></paramdef>
97 </funcprototype>
98 <funcprototype>
99 <funcdef>void <function>glVertexAttribI3ui</function></funcdef>
100 <paramdef>GLuint <parameter>index</parameter></paramdef>
101 <paramdef>GLoint <parameter>v0</parameter></paramdef>
102 <paramdef>GLoint <parameter>v1</parameter></paramdef>
103 <paramdef>GLoint <parameter>v2</parameter></paramdef>
104 </funcprototype>
105 <funcprototype>
106 <funcdef>void <function>glVertexAttrib4f</function></funcdef>
107 <paramdef>GLuint <parameter>index</parameter></paramdef>
108 <paramdef>GLfloat <parameter>v0</parameter></paramdef>
109 <paramdef>GLfloat <parameter>v1</parameter></paramdef>
110 <paramdef>GLfloat <parameter>v2</parameter></paramdef>
111 <paramdef>GLfloat <parameter>v3</parameter></paramdef>
112 </funcprototype>
113 <funcprototype>
114 <funcdef>void <function>glVertexAttrib4s</function></funcdef>
115 <paramdef>GLuint <parameter>index</parameter></paramdef>
116 <paramdef>GLshort <parameter>v0</parameter></paramdef>
117 <paramdef>GLshort <parameter>v1</parameter></paramdef>
118 <paramdef>GLshort <parameter>v2</parameter></paramdef>
119 <paramdef>GLshort <parameter>v3</parameter></paramdef>
120 </funcprototype>
121 <funcprototype>
122 <funcdef>void <function>glVertexAttrib4d</function></funcdef>
123 <paramdef>GLuint <parameter>index</parameter></paramdef>
124 <paramdef>GLdouble <parameter>v0</parameter></paramdef>
125 <paramdef>GLdouble <parameter>v1</parameter></paramdef>
126 <paramdef>GLdouble <parameter>v2</parameter></paramdef>
127 <paramdef>GLdouble <parameter>v3</parameter></paramdef>
128 </funcprototype>
129 <funcprototype>
130 <funcdef>void <function>glVertexAttrib4Nub</function></funcdef>
131 <paramdef>GLuint <parameter>index</parameter></paramdef>
132 <paramdef>GLubyte <parameter>v0</parameter></paramdef>
133 <paramdef>GLubyte <parameter>v1</parameter></paramdef>
134 <paramdef>GLubyte <parameter>v2</parameter></paramdef>
135 <paramdef>GLubyte <parameter>v3</parameter></paramdef>
136 </funcprototype>
137 <funcprototype>
138 <funcdef>void <function>glVertexAttribI4i</function></funcdef>
139 <paramdef>GLuint <parameter>index</parameter></paramdef>
140 <paramdef>GLint <parameter>v0</parameter></paramdef>
141 <paramdef>GLint <parameter>v1</parameter></paramdef>
142 <paramdef>GLint <parameter>v2</parameter></paramdef>
143 <paramdef>GLint <parameter>v3</parameter></paramdef>
144 </funcprototype>
145 <funcprototype>
146 <funcdef>void <function>glVertexAttribI4ui</function></funcdef>
147 <paramdef>GLuint <parameter>index</parameter></paramdef>
148 <paramdef>GLuint <parameter>v0</parameter></paramdef>
149 <paramdef>GLuint <parameter>v1</parameter></paramdef>
150 <paramdef>GLuint <parameter>v2</parameter></paramdef>
151 <paramdef>GLuint <parameter>v3</parameter></paramdef>
152 </funcprototype>
153 </funcsynopsis>
154 </refsynopsisdiv>
155 <refsect1 id="parameters"><title>Parameters</title>
156 <variablelist>
157 <varlistentry>
158 <term><parameter>index</parameter></term>
159 <listitem>
160 <para>Specifies the index of the generic vertex
161 attribute to be modified.</para>
162 </listitem>
163 </varlistentry>
164 <varlistentry>
165 <term>
166 <parameter>v0</parameter>,
167 <parameter>v1</parameter>,
168 <parameter>v2</parameter>,
169 <parameter>v3</parameter>
170 </term>
171 <listitem>
172 <para>Specifies the new values to be used for the
173 specified vertex attribute.</para>
174 </listitem>
175 </varlistentry>
176 </variablelist>
177 </refsect1>
178 <refsynopsisdiv><title>C Specification</title>
179 <funcsynopsis>
180 <funcprototype>
181 <funcdef>void <function>glVertexAttrib1fv</function></funcdef>
182 <paramdef>GLuint <parameter>index</parameter></paramdef>
183 <paramdef>const GLfloat *<parameter>v</parameter></paramdef>
184 </funcprototype>
185 <funcprototype>
186 <funcdef>void <function>glVertexAttrib1sv</function></funcdef>
187 <paramdef>GLuint <parameter>index</parameter></paramdef>
188 <paramdef>const GLshort *<parameter>v</parameter></paramdef>
189 </funcprototype>
190 <funcprototype>
191 <funcdef>void <function>glVertexAttrib1dv</function></funcdef>
192 <paramdef>GLuint <parameter>index</parameter></paramdef>
193 <paramdef>const GLdouble *<parameter>v</parameter></paramdef>
194 </funcprototype>
195 <funcprototype>
196 <funcdef>void <function>glVertexAttribI1iv</function></funcdef>
197 <paramdef>GLuint <parameter>index</parameter></paramdef>
198 <paramdef>const GLint *<parameter>v</parameter></paramdef>
199 </funcprototype>
200 <funcprototype>
201 <funcdef>void <function>glVertexAttribI1uiv</function></funcdef>
202 <paramdef>GLuint <parameter>index</parameter></paramdef>
203 <paramdef>const GLuint *<parameter>v</parameter></paramdef>
204 </funcprototype>
205 <funcprototype>
206 <funcdef>void <function>glVertexAttrib2fv</function></funcdef>
207 <paramdef>GLuint <parameter>index</parameter></paramdef>
208 <paramdef>const GLfloat *<parameter>v</parameter></paramdef>
209 </funcprototype>
210 <funcprototype>
211 <funcdef>void <function>glVertexAttrib2sv</function></funcdef>
212 <paramdef>GLuint <parameter>index</parameter></paramdef>
213 <paramdef>const GLshort *<parameter>v</parameter></paramdef>
214 </funcprototype>
215 <funcprototype>
216 <funcdef>void <function>glVertexAttrib2dv</function></funcdef>
217 <paramdef>GLuint <parameter>index</parameter></paramdef>
218 <paramdef>const GLdouble *<parameter>v</parameter></paramdef>
219 </funcprototype>
220 <funcprototype>
221 <funcdef>void <function>glVertexAttribI2iv</function></funcdef>
222 <paramdef>GLuint <parameter>index</parameter></paramdef>
223 <paramdef>const GLint *<parameter>v</parameter></paramdef>
224 </funcprototype>
225 <funcprototype>
226 <funcdef>void <function>glVertexAttribI2uiv</function></funcdef>
227 <paramdef>GLuint <parameter>index</parameter></paramdef>
228 <paramdef>const GLuint *<parameter>v</parameter></paramdef>
229 </funcprototype>
230 <funcprototype>
231 <funcdef>void <function>glVertexAttrib3fv</function></funcdef>
232 <paramdef>GLuint <parameter>index</parameter></paramdef>
233 <paramdef>const GLfloat *<parameter>v</parameter></paramdef>
234 </funcprototype>
235 <funcprototype>
236 <funcdef>void <function>glVertexAttrib3sv</function></funcdef>
237 <paramdef>GLuint <parameter>index</parameter></paramdef>
238 <paramdef>const GLshort *<parameter>v</parameter></paramdef>
239 </funcprototype>
240 <funcprototype>
241 <funcdef>void <function>glVertexAttrib3dv</function></funcdef>
242 <paramdef>GLuint <parameter>index</parameter></paramdef>
243 <paramdef>const GLdouble *<parameter>v</parameter></paramdef>
244 </funcprototype>
245 <funcprototype>
246 <funcdef>void <function>glVertexAttribI3iv</function></funcdef>
247 <paramdef>GLuint <parameter>index</parameter></paramdef>
248 <paramdef>const GLint *<parameter>v</parameter></paramdef>
249 </funcprototype>
250 <funcprototype>
251 <funcdef>void <function>glVertexAttribI3uiv</function></funcdef>
252 <paramdef>GLuint <parameter>index</parameter></paramdef>
253 <paramdef>const GLuint *<parameter>v</parameter></paramdef>
254 </funcprototype>
255 <funcprototype>
256 <funcdef>void <function>glVertexAttrib4fv</function></funcdef>
257 <paramdef>GLuint <parameter>index</parameter></paramdef>
258 <paramdef>const GLfloat *<parameter>v</parameter></paramdef>
259 </funcprototype>
260 <funcprototype>
261 <funcdef>void <function>glVertexAttrib4sv</function></funcdef>
262 <paramdef>GLuint <parameter>index</parameter></paramdef>
263 <paramdef>const GLshort *<parameter>v</parameter></paramdef>
264 </funcprototype>
265 <funcprototype>
266 <funcdef>void <function>glVertexAttrib4dv</function></funcdef>
267 <paramdef>GLuint <parameter>index</parameter></paramdef>
268 <paramdef>const GLdouble *<parameter>v</parameter></paramdef>
269 </funcprototype>
270 <funcprototype>
271 <funcdef>void <function>glVertexAttrib4iv</function></funcdef>
272 <paramdef>GLuint <parameter>index</parameter></paramdef>
273 <paramdef>const GLint *<parameter>v</parameter></paramdef>
274 </funcprototype>
275 <funcprototype>
276 <funcdef>void <function>glVertexAttrib4bv</function></funcdef>
277 <paramdef>GLuint <parameter>index</parameter></paramdef>
278 <paramdef>const GLbyte *<parameter>v</parameter></paramdef>
279 </funcprototype>
280 <funcprototype>
281 <funcdef>void <function>glVertexAttrib4ubv</function></funcdef>
282 <paramdef>GLuint <parameter>index</parameter></paramdef>
283 <paramdef>const GLubyte *<parameter>v</parameter></paramdef>
284 </funcprototype>
285 <funcprototype>
286 <funcdef>void <function>glVertexAttrib4usv</function></funcdef>
287 <paramdef>GLuint <parameter>index</parameter></paramdef>
288 <paramdef>const GLushort *<parameter>v</parameter></paramdef>
289 </funcprototype>
290 <funcprototype>
291 <funcdef>void <function>glVertexAttrib4uiv</function></funcdef>
292 <paramdef>GLuint <parameter>index</parameter></paramdef>
293 <paramdef>const GLuint *<parameter>v</parameter></paramdef>
294 </funcprototype>
295 <funcprototype>
296 <funcdef>void <function>glVertexAttrib4Nbv</function></funcdef>
297 <paramdef>GLuint <parameter>index</parameter></paramdef>
298 <paramdef>const GLbyte *<parameter>v</parameter></paramdef>
299 </funcprototype>
300 <funcprototype>
301 <funcdef>void <function>glVertexAttrib4Nsv</function></funcdef>
302 <paramdef>GLuint <parameter>index</parameter></paramdef>
303 <paramdef>const GLshort *<parameter>v</parameter></paramdef>
304 </funcprototype>
305 <funcprototype>
306 <funcdef>void <function>glVertexAttrib4Niv</function></funcdef>
307 <paramdef>GLuint <parameter>index</parameter></paramdef>
308 <paramdef>const GLint *<parameter>v</parameter></paramdef>
309 </funcprototype>
310 <funcprototype>
311 <funcdef>void <function>glVertexAttrib4Nubv</function></funcdef>
312 <paramdef>GLuint <parameter>index</parameter></paramdef>
313 <paramdef>const GLubyte *<parameter>v</parameter></paramdef>
314 </funcprototype>
315 <funcprototype>
316 <funcdef>void <function>glVertexAttrib4Nusv</function></funcdef>
317 <paramdef>GLuint <parameter>index</parameter></paramdef>
318 <paramdef>const GLushort *<parameter>v</parameter></paramdef>
319 </funcprototype>
320 <funcprototype>
321 <funcdef>void <function>glVertexAttrib4Nuiv</function></funcdef>
322 <paramdef>GLuint <parameter>index</parameter></paramdef>
323 <paramdef>const GLuint *<parameter>v</parameter></paramdef>
324 </funcprototype>
325 <funcprototype>
326 <funcdef>void <function>glVertexAttribI4bv</function></funcdef>
327 <paramdef>GLuint <parameter>index</parameter></paramdef>
328 <paramdef>const GLbyte *<parameter>v</parameter></paramdef>
329 </funcprototype>
330 <funcprototype>
331 <funcdef>void <function>glVertexAttribI4ubv</function></funcdef>
332 <paramdef>GLuint <parameter>index</parameter></paramdef>
333 <paramdef>const GLubyte *<parameter>v</parameter></paramdef>
334 </funcprototype>
335 <funcprototype>
336 <funcdef>void <function>glVertexAttribI4sv</function></funcdef>
337 <paramdef>GLuint <parameter>index</parameter></paramdef>
338 <paramdef>const GLshort *<parameter>v</parameter></paramdef>
339 </funcprototype>
340 <funcprototype>
341 <funcdef>void <function>glVertexAttribI4usv</function></funcdef>
342 <paramdef>GLuint <parameter>index</parameter></paramdef>
343 <paramdef>const GLushort *<parameter>v</parameter></paramdef>
344 </funcprototype>
345 <funcprototype>
346 <funcdef>void <function>glVertexAttribI4iv</function></funcdef>
347 <paramdef>GLuint <parameter>index</parameter></paramdef>
348 <paramdef>const GLint *<parameter>v</parameter></paramdef>
349 </funcprototype>
350 <funcprototype>
351 <funcdef>void <function>glVertexAttribI4uiv</function></funcdef>
352 <paramdef>GLuint <parameter>index</parameter></paramdef>
353 <paramdef>const GLuint *<parameter>v</parameter></paramdef>
354 </funcprototype>
355 </funcsynopsis>
356 </refsynopsisdiv>
357 <refsect1 id="parameters2"><title>Parameters</title>
358 <variablelist>
359 <varlistentry>
360 <term><parameter>index</parameter></term>
361 <listitem>
362 <para>Specifies the index of the generic vertex
363 attribute to be modified.</para>
364 </listitem>
365 </varlistentry>
366 <varlistentry>
367 <term><parameter>v</parameter></term>
368 <listitem>
369 <para>Specifies a pointer to an array of values to
370 be used for the generic vertex attribute.</para>
371 </listitem>
372 </varlistentry>
373 </variablelist>
374 </refsect1>
375 <refsynopsisdiv><title>C Specification</title>
376 <funcsynopsis>
377 <funcprototype>
378 <funcdef>void <function>glVertexAttribP1ui</function></funcdef>
379 <paramdef>GLuint <parameter>index</parameter></paramdef>
380 <paramdef>GLenum <parameter>type</parameter></paramdef>
381 <paramdef>GLboolean <parameter>normalized</parameter></paramdef>
382 <paramdef>GLuint <parameter>value</parameter></paramdef>
383 </funcprototype>
384 <funcprototype>
385 <funcdef>void <function>glVertexAttribP2ui</function></funcdef>
386 <paramdef>GLuint <parameter>index</parameter></paramdef>
387 <paramdef>GLenum <parameter>type</parameter></paramdef>
388 <paramdef>GLboolean <parameter>normalized</parameter></paramdef>
389 <paramdef>GLuint <parameter>value</parameter></paramdef>
390 </funcprototype>
391 <funcprototype>
392 <funcdef>void <function>glVertexAttribP3ui</function></funcdef>
393 <paramdef>GLuint <parameter>index</parameter></paramdef>
394 <paramdef>GLenum <parameter>type</parameter></paramdef>
395 <paramdef>GLboolean <parameter>normalized</parameter></paramdef>
396 <paramdef>GLuint <parameter>value</parameter></paramdef>
397 </funcprototype>
398 <funcprototype>
399 <funcdef>void <function>glVertexAttribP4ui</function></funcdef>
400 <paramdef>GLuint <parameter>index</parameter></paramdef>
401 <paramdef>GLenum <parameter>type</parameter></paramdef>
402 <paramdef>GLboolean <parameter>normalized</parameter></paramdef>
403 <paramdef>GLuint <parameter>value</parameter></paramdef>
404 </funcprototype>
405 </funcsynopsis>
406 </refsynopsisdiv>
407 <refsect1 id="parameters3"><title>Parameters</title>
408 <variablelist>
409 <varlistentry>
410 <term><parameter>index</parameter></term>
411 <listitem>
412 <para>Specifies the index of the generic vertex
413 attribute to be modified.</para>
414 </listitem>
415 </varlistentry>
416 <varlistentry>
417 <term><parameter>type</parameter></term>
418 <listitem>
419 <para>Type of packing used on the data. This parameter must be
420 <constant>GL_INT_10_10_10_2</constant> or <constant>GL_UNSIGNED_INT_10_10_10_2</constant>
421 to specify signed or unsigned data, respectively.</para>
422 </listitem>
423 </varlistentry>
424 <varlistentry>
425 <term><parameter>normalized</parameter></term>
426 <listitem>
427 <para>If <constant>GL_TRUE</constant>, then the values are to be
428 converted to floating point values by normalizing. Otherwise,
429 they are converted directly to floating point values.</para>
430 </listitem>
431 </varlistentry>
432 <varlistentry>
433 <term>
434 <parameter>value</parameter>
435 </term>
436 <listitem>
437 <para>Specifies the new packed value to be used for the
438 specified vertex attribute.</para>
439 </listitem>
440 </varlistentry>
441 </variablelist>
442 </refsect1>
443 <refsect1 id="description"><title>Description</title>
444 <para>OpenGL defines a number of standard vertex attributes that
445 applications can modify with standard API entry points (color,
446 normal, texture coordinates, etc.). The
447 <function>glVertexAttrib</function> family of entry points
448 allows an application to pass generic vertex attributes in
449 numbered locations.</para>
450
451 <para>Generic attributes are defined as four-component values
452 that are organized into an array. The first entry of this array
453 is numbered 0, and the size of the array is specified by the
454 implementation-dependent constant
455 <constant>GL_MAX_VERTEX_ATTRIBS</constant>. Individual elements
456 of this array can be modified with a
457 <function>glVertexAttrib</function> call that specifies the
458 index of the element to be modified and a value for that
459 element.</para>
460
461 <para>These commands can be used to specify one, two, three, or
462 all four components of the generic vertex attribute specified by
463 <parameter>index</parameter>. A <function>1</function> in the
464 name of the command indicates that only one value is passed, and
465 it will be used to modify the first component of the generic
466 vertex attribute. The second and third components will be set to
467 0, and the fourth component will be set to 1. Similarly, a
468 <function>2</function> in the name of the command indicates that
469 values are provided for the first two components, the third
470 component will be set to 0, and the fourth component will be set
471 to 1. A <function>3</function> in the name of the command
472 indicates that values are provided for the first three
473 components and the fourth component will be set to 1, whereas a
474 <function>4</function> in the name indicates that values are
475 provided for all four components.</para>
476
477 <para>The letters <function>s</function>,
478 <function>f</function>, <function>i</function>,
479 <function>d</function>, <function>ub</function>,
480 <function>us</function>, and <function>ui</function> indicate
481 whether the arguments are of type short, float, int, double,
482 unsigned byte, unsigned short, or unsigned int. When
483 <function>v</function> is appended to the name, the commands can
484 take a pointer to an array of such values.</para>
485
486 <para>Additional capitalized letters can indicate further alterations
487 to the default behavior of the glVertexAttrib function:</para>
488
489 <para>
490 The commands containing <function>N</function> indicate that
491 the arguments will be passed as fixed-point values that are
492 scaled to a normalized range according to the component
493 conversion rules defined by the OpenGL specification. Signed
494 values are understood to represent fixed-point values in the
495 range [-1,1], and unsigned values are understood to represent
496 fixed-point values in the range [0,1].
497 </para>
498
499 <para>
500 The commands containing <function>I</function> indicate that
501 the arguments are extended to full signed or unsigned integers.
502 </para>
503
504 <para>
505 The commands containing <function>P</function> indicate that
506 the arguments are stored as packed components within a larger
507 natural type.
508 </para>
509
510 <para>OpenGL Shading Language attribute variables are allowed to
511 be of type mat2, mat3, or mat4. Attributes of these types may be
512 loaded using the <function>glVertexAttrib</function> entry
513 points. Matrices must be loaded into successive generic
514 attribute slots in column major order, with one column of the
515 matrix in each generic attribute slot.</para>
516
517 <para>A user-defined attribute variable declared in a vertex
518 shader can be bound to a generic attribute index by calling
519 <citerefentry><refentrytitle>glBindAttribLocation</refentrytitle></citerefentry>.
520 This allows an application to use more descriptive variable
521 names in a vertex shader. A subsequent change to the specified
522 generic vertex attribute will be immediately reflected as a
523 change to the corresponding attribute variable in the vertex
524 shader.</para>
525
526 <para>The binding between a generic vertex attribute index and a
527 user-defined attribute variable in a vertex shader is part of
528 the state of a program object, but the current value of the
529 generic vertex attribute is not. The value of each generic
530 vertex attribute is part of current state, just like standard
531 vertex attributes, and it is maintained even if a different
532 program object is used.</para>
533
534 <para>An application may freely modify generic vertex attributes
535 that are not bound to a named vertex shader attribute variable.
536 These values are simply maintained as part of current state and
537 will not be accessed by the vertex shader. If a generic vertex
538 attribute bound to an attribute variable in a vertex shader is
539 not updated while the vertex shader is executing, the vertex
540 shader will repeatedly use the current value for the generic
541 vertex attribute.</para>
542 </refsect1>
543 <refsect1 id="notes"><title>Notes</title>
544 <para>Generic vertex attributes can be updated at any time.</para>
545
546 <para>It is possible for an application to bind more than one
547 attribute name to the same generic vertex attribute index. This
548 is referred to as aliasing, and it is allowed only if just one
549 of the aliased attribute variables is active in the vertex
550 shader, or if no path through the vertex shader consumes more
551 than one of the attributes aliased to the same location. OpenGL
552 implementations are not required to do error checking to detect
553 aliasing, they are allowed to assume that aliasing will not
554 occur, and they are allowed to employ optimizations that work
555 only in the absence of aliasing.</para>
556
557 <para>There is no provision for binding standard vertex
558 attributes; therefore, it is not possible to alias generic
559 attributes with standard attributes.</para>
560
561 <para>
562 <function>glVertexAttrib4bv</function>, <function>glVertexAttrib4sv</function>,
563 <function>glVertexAttrib4iv</function>, <function>glVertexAttrib4ubv</function>,
564 <function>glVertexAttrib4usv</function>, <function>glVertexAttrib4uiv</function>, and
565 <function>glVertexAttrib4N</function> versions are available only if the GL version is 3.1 or higher.
566 </para>
567
568 <para>
569 <function>glVertexAttribP</function> versions are available only if the GL version is 3.3 or higher.
570 </para>
571 </refsect1>
572 <refsect1 id="errors"><title>Errors</title>
573 <para><constant>GL_INVALID_VALUE</constant> is generated if
574 <parameter>index</parameter> is greater than or equal to
575 <constant>GL_MAX_VERTEX_ATTRIBS</constant>.</para>
576
577 <para><constant>GL_INVALID_ENUM</constant> is generated if
578 <function>glVertexAttribP</function> is used with a
579 <parameter>type</parameter> other than
580 <constant>GL_INT_10_10_10_2</constant> or
581 <constant>GL_UNSIGNED_INT_10_10_10_2</constant>.</para>
582 </refsect1>
583 <refsect1 id="associatedgets"><title>Associated Gets</title>
584 <para><citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
585 with the argument <constant>GL_CURRENT_PROGRAM</constant></para>
586
587 <para><citerefentry><refentrytitle>glGetActiveAttrib</refentrytitle></citerefentry>
588 with argument <parameter>program</parameter> and the index of an active
589 attribute variable</para>
590
591 <para><citerefentry><refentrytitle>glGetAttribLocation</refentrytitle></citerefentry>
592 with argument <parameter>program</parameter> and an attribute
593 variable name</para>
594
595 <para><citerefentry><refentrytitle>glGetVertexAttrib</refentrytitle></citerefentry>
596 with arguments <constant>GL_CURRENT_VERTEX_ATTRIB</constant> and
597 <parameter>index</parameter></para>
598 </refsect1>
599 <refsect1 id="seealso"><title>See Also</title>
600 <para><citerefentry><refentrytitle>glBindAttribLocation</refentrytitle></citerefentry>,
601 <citerefentry><refentrytitle>glVertexAttribPointer</refentrytitle></citerefentry></para>
602 </refsect1>
603 <refsect1 id="Copyright"><title>Copyright</title>
604 <para>
605 Copyright <trademark class="copyright"></trademark> 2003-2005 3Dlabs Inc. Ltd.
606 This material may be distributed subject to the terms and conditions set forth in
607 the Open Publication License, v 1.0, 8 June 1999.
608 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
609 </para>
610 </refsect1>
611 </refentry>