1e103a03e79ebacd84da207ac9d749a2d9318f83
[clinton/guile-figl.git] / upstream-man-pages / man2 / glArrayElement.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="glArrayElement">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>1991-2006</year>
9 <holder>Silicon Graphics, Inc.</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glArrayElement</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glArrayElement</refname>
17 <refpurpose>render a vertex using the specified vertex array element</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glArrayElement</function></funcdef>
23 <paramdef>GLint <parameter>i</parameter></paramdef>
24 </funcprototype>
25 </funcsynopsis>
26 </refsynopsisdiv>
27 <!-- eqn: ignoring delim $$ -->
28 <refsect1 id="parameters"><title>Parameters</title>
29 <variablelist>
30 <varlistentry>
31 <term><parameter>i</parameter></term>
32 <listitem>
33 <para>
34 Specifies an index into the enabled vertex data arrays.
35 </para>
36 </listitem>
37 </varlistentry>
38 </variablelist>
39 </refsect1>
40 <refsect1 id="description"><title>Description</title>
41 <para>
42 <function>glArrayElement</function> commands are used within <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>/<citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry> pairs to
43 specify vertex and attribute data for point, line, and polygon
44 primitives. If <constant>GL_VERTEX_ARRAY</constant> is enabled when <function>glArrayElement</function> is called, a
45 single vertex is drawn, using
46 vertex and attribute data taken from location <parameter>i</parameter> of the enabled
47 arrays. If <constant>GL_VERTEX_ARRAY</constant> is not enabled, no drawing occurs but
48 the attributes corresponding to the enabled arrays are modified.
49 </para>
50 <para>
51 Use <function>glArrayElement</function> to construct primitives by indexing vertex data, rather than
52 by streaming through arrays of data in first-to-last order. Because
53 each call specifies only a single vertex, it is possible to explicitly
54 specify per-primitive attributes such as a single normal for each
55 triangle.
56 </para>
57 <para>
58 Changes made to array data between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the
59 corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry> may affect calls to <function>glArrayElement</function> that are made
60 within the same <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>/<citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry> period in nonsequential ways.
61 That is, a call to
62 <function>glArrayElement</function> that precedes a change to array data may
63 access the changed data, and a call that follows a change to array data
64 may access original data.
65 </para>
66 </refsect1>
67 <refsect1 id="notes"><title>Notes</title>
68 <para>
69 <function>glArrayElement</function> is available only if the GL version is 1.1 or greater.
70 </para>
71 <para>
72 <function>glArrayElement</function> is included in display lists. If <function>glArrayElement</function> is entered into a
73 display list, the necessary array data (determined by the array
74 pointers and enables) is also entered into the display list. Because
75 the array pointers and enables are client-side state, their values
76 affect display lists when the lists are created, not when the lists
77 are executed.
78 </para>
79 </refsect1>
80 <refsect1 id="errors"><title>Errors</title>
81 <para>
82 <constant>GL_INVALID_VALUE</constant> may be generated if <parameter>i</parameter> is negative.
83 </para>
84 <para>
85 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to an
86 enabled array and the buffer object's data store is currently mapped.
87 </para>
88 </refsect1>
89 <refsect1 id="seealso"><title>See Also</title>
90 <para>
91 <citerefentry><refentrytitle>glClientActiveTexture</refentrytitle></citerefentry>,
92 <citerefentry><refentrytitle>glColorPointer</refentrytitle></citerefentry>,
93 <citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>,
94 <citerefentry><refentrytitle>glEdgeFlagPointer</refentrytitle></citerefentry>,
95 <citerefentry><refentrytitle>glFogCoordPointer</refentrytitle></citerefentry>,
96 <citerefentry><refentrytitle>glGetPointerv</refentrytitle></citerefentry>,
97 <citerefentry><refentrytitle>glIndexPointer</refentrytitle></citerefentry>,
98 <citerefentry><refentrytitle>glInterleavedArrays</refentrytitle></citerefentry>,
99 <citerefentry><refentrytitle>glNormalPointer</refentrytitle></citerefentry>,
100 <citerefentry><refentrytitle>glSecondaryColorPointer</refentrytitle></citerefentry>,
101 <citerefentry><refentrytitle>glTexCoordPointer</refentrytitle></citerefentry>,
102 <citerefentry><refentrytitle>glVertexPointer</refentrytitle></citerefentry>
103 </para>
104 </refsect1>
105 <refsect1 id="Copyright"><title>Copyright</title>
106 <para>
107 Copyright <trademark class="copyright"></trademark> 1991-2006
108 Silicon Graphics, Inc. This document is licensed under the SGI
109 Free Software B License. For details, see
110 <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
111 </para>
112 </refsect1>
113 </refentry>