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