rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / glIndexPointer.xml
CommitLineData
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="glIndexPointer">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>1991-2006</year>
9 <holder>Silicon Graphics, Inc.</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glIndexPointer</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glIndexPointer</refname>
17 <refpurpose>define an array of color indexes</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glIndexPointer</function></funcdef>
23 <paramdef>GLenum <parameter>type</parameter></paramdef>
24 <paramdef>GLsizei <parameter>stride</parameter></paramdef>
25 <paramdef>const GLvoid * <parameter>pointer</parameter></paramdef>
26 </funcprototype>
27 </funcsynopsis>
28 </refsynopsisdiv>
29 <!-- eqn: ignoring delim $$ -->
30 <refsect1 id="parameters"><title>Parameters</title>
31 <variablelist>
32 <varlistentry>
33 <term><parameter>type</parameter></term>
34 <listitem>
35 <para>
36 Specifies the data type of each color index in the array.
37 Symbolic constants
38 <constant>GL_UNSIGNED_BYTE</constant>,
39 <constant>GL_SHORT</constant>,
40 <constant>GL_INT</constant>,
41 <constant>GL_FLOAT</constant>,
42 and <constant>GL_DOUBLE</constant>
43 are accepted. The initial value is <constant>GL_FLOAT</constant>.
44 </para>
45 </listitem>
46 </varlistentry>
47 <varlistentry>
48 <term><parameter>stride</parameter></term>
49 <listitem>
50 <para>
51 Specifies the byte offset between consecutive color indexes.
52 If <parameter>stride</parameter> is 0, the color indexes are understood to
53 be tightly packed in the array. The initial value is 0.
54 </para>
55 </listitem>
56 </varlistentry>
57 <varlistentry>
58 <term><parameter>pointer</parameter></term>
59 <listitem>
60 <para>
61 Specifies a pointer to the first index in the array.
62 The initial value is 0.
63 </para>
64 </listitem>
65 </varlistentry>
66 </variablelist>
67 </refsect1>
68 <refsect1 id="description"><title>Description</title>
69 <para>
70 <function>glIndexPointer</function> specifies the location and data format of an array of color indexes
71 to use when rendering.
72 <parameter>type</parameter> specifies the data type of
73 each color index and <parameter>stride</parameter> specifies the byte stride from one
74 color index to the next, allowing vertices and attributes
75 to be packed into a single array or stored in separate arrays.
76 </para>
77 <para>
78 If a non-zero named buffer object is bound to the <constant>GL_ARRAY_BUFFER</constant> target
79 (see <citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry>) while a color index array is
80 specified, <parameter>pointer</parameter> is treated as a byte offset into the buffer object's data store.
81 Also, the buffer object binding (<constant>GL_ARRAY_BUFFER_BINDING</constant>) is saved as color index vertex array
82 client-side state (<constant>GL_INDEX_ARRAY_BUFFER_BINDING</constant>).
83 </para>
84 <para>
85 When a color index array is specified,
86 <parameter>type</parameter>, <parameter>stride</parameter>, and <parameter>pointer</parameter> are saved as client-side
87 state, in addition to the current vertex array buffer object binding.
88 </para>
89 <para>
90 To enable and disable the color index array, call
91 <citerefentry><refentrytitle>glEnableClientState</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisableClientState</refentrytitle></citerefentry> with the argument
92 <constant>GL_INDEX_ARRAY</constant>. If
93 enabled, the color index array is used
94 when <citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glMultiDrawArrays</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>,
95 <citerefentry><refentrytitle>glMultiDrawElements</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glDrawRangeElements</refentrytitle></citerefentry>, or
96 <citerefentry><refentrytitle>glArrayElement</refentrytitle></citerefentry> is called.
97 </para>
98 </refsect1>
99 <refsect1 id="notes"><title>Notes</title>
100 <para>
101 <function>glIndexPointer</function> is available only if the GL version is 1.1 or greater.
102 </para>
103 <para>
104 Color indexes are not supported for interleaved vertex array formats
105 (see <citerefentry><refentrytitle>glInterleavedArrays</refentrytitle></citerefentry>).
106 </para>
107 <para>
108 The color index array is initially disabled and isn't accessed when
109 <citerefentry><refentrytitle>glArrayElement</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glDrawRangeElements</refentrytitle></citerefentry>,
110 <citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glMultiDrawArrays</refentrytitle></citerefentry>, or <citerefentry><refentrytitle>glMultiDrawElements</refentrytitle></citerefentry>
111 is called.
112 </para>
113 <para>
114 Execution of <function>glIndexPointer</function> is not allowed between
115 <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>,
116 but an error may or may not be generated. If an error is not generated,
117 the operation is undefined.
118 </para>
119 <para>
120 <function>glIndexPointer</function> is typically implemented on the client side.
121 </para>
122 <para>
123 Color index array parameters are client-side state and are
124 therefore not saved or restored by <citerefentry><refentrytitle>glPushAttrib</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glPopAttrib</refentrytitle></citerefentry>.
125 Use <citerefentry><refentrytitle>glPushClientAttrib</refentrytitle></citerefentry> and
126 <citerefentry><refentrytitle>glPopClientAttrib</refentrytitle></citerefentry> instead.
127 </para>
128 </refsect1>
129 <refsect1 id="errors"><title>Errors</title>
130 <para>
131 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>type</parameter> is not an accepted value.
132 </para>
133 <para>
134 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>stride</parameter> is negative.
135 </para>
136 </refsect1>
137 <refsect1 id="associatedgets"><title>Associated Gets</title>
138 <para>
139 <citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_INDEX_ARRAY</constant>
140 </para>
141 <para>
142 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_INDEX_ARRAY_TYPE</constant>
143 </para>
144 <para>
145 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_INDEX_ARRAY_STRIDE</constant>
146 </para>
147 <para>
148 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_INDEX_ARRAY_BUFFER_BINDING</constant>
149 </para>
150 <para>
151 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_ARRAY_BUFFER_BINDING</constant>
152 </para>
153 <para>
154 <citerefentry><refentrytitle>glGetPointerv</refentrytitle></citerefentry> with argument <constant>GL_INDEX_ARRAY_POINTER</constant>
155 </para>
156 </refsect1>
157 <refsect1 id="seealso"><title>See Also</title>
158 <para>
159 <citerefentry><refentrytitle>glArrayElement</refentrytitle></citerefentry>,
160 <citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry>,
161 <citerefentry><refentrytitle>glColorPointer</refentrytitle></citerefentry>,
162 <citerefentry><refentrytitle>glDisableClientState</refentrytitle></citerefentry>,
163 <citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>,
164 <citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>,
165 <citerefentry><refentrytitle>glDrawRangeElements</refentrytitle></citerefentry>,
166 <citerefentry><refentrytitle>glEdgeFlagPointer</refentrytitle></citerefentry>,
167 <citerefentry><refentrytitle>glEnableClientState</refentrytitle></citerefentry>,
168 <citerefentry><refentrytitle>glFogCoordPointer</refentrytitle></citerefentry>,
169 <citerefentry><refentrytitle>glIndex</refentrytitle></citerefentry>,
170 <citerefentry><refentrytitle>glInterleavedArrays</refentrytitle></citerefentry>,
171 <citerefentry><refentrytitle>glMultiDrawArrays</refentrytitle></citerefentry>,
172 <citerefentry><refentrytitle>glMultiDrawElements</refentrytitle></citerefentry>,
173 <citerefentry><refentrytitle>glNormalPointer</refentrytitle></citerefentry>,
174 <citerefentry><refentrytitle>glPopClientAttrib</refentrytitle></citerefentry>,
175 <citerefentry><refentrytitle>glPushClientAttrib</refentrytitle></citerefentry>,
176 <citerefentry><refentrytitle>glSecondaryColorPointer</refentrytitle></citerefentry>,
177 <citerefentry><refentrytitle>glTexCoordPointer</refentrytitle></citerefentry>,
178 <citerefentry><refentrytitle>glVertexAttribPointer</refentrytitle></citerefentry>,
179 <citerefentry><refentrytitle>glVertexPointer</refentrytitle></citerefentry>
180 </para>
181 </refsect1>
182 <refsect1 id="Copyright"><title>Copyright</title>
183 <para>
184 Copyright <trademark class="copyright"></trademark> 1991-2006
185 Silicon Graphics, Inc. This document is licensed under the SGI
186 Free Software B License. For details, see
187 <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
188 </para>
189 </refsect1>
190</refentry>