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=
"glTexCoordPointer">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glTexCoordPointer
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glTexCoordPointer
</refname>
17 <refpurpose>define an array of texture coordinates
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glTexCoordPointer
</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>
30 <!-- eqn: ignoring delim $$ -->
31 <refsect1 id=
"parameters"><title>Parameters
</title>
34 <term><parameter>size
</parameter></term>
37 Specifies the number of coordinates per array element. Must be
1,
2,
3,
38 or
4. The initial value is
4.
43 <term><parameter>type
</parameter></term>
46 Specifies the data type of each texture coordinate.
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>.
57 <term><parameter>stride
</parameter></term>
60 Specifies the byte offset between consecutive texture coordinate sets.
61 If
<parameter>stride
</parameter> is
0, the array elements are understood
62 to be tightly packed. The initial value is
0.
67 <term><parameter>pointer
</parameter></term>
70 Specifies a pointer to the first coordinate of the first texture coordinate set in the
71 array. The initial value is
0.
77 <refsect1 id=
"description"><title>Description
</title>
79 <function>glTexCoordPointer
</function> specifies the location and data format of an array of texture
80 coordinates to use when rendering.
81 <parameter>size
</parameter> specifies the number of coordinates per
82 texture coordinate set, and must be
1,
2,
3, or
4.
83 <parameter>type
</parameter> specifies the data type of each texture coordinate,
84 and
<parameter>stride
</parameter> specifies the byte stride from one
85 texture coordinate set to the next, allowing vertices and attributes
86 to be packed into a single array or stored in separate arrays.
87 (Single-array storage may be more efficient on some implementations;
89 <citerefentry><refentrytitle>glInterleavedArrays
</refentrytitle></citerefentry>.)
92 If a non-zero named buffer object is bound to the
<constant>GL_ARRAY_BUFFER
</constant> target
93 (see
<citerefentry><refentrytitle>glBindBuffer
</refentrytitle></citerefentry>) while a texture coordinate array is
94 specified,
<parameter>pointer
</parameter> is treated as a byte offset into the buffer object's data store.
95 Also, the buffer object binding (
<constant>GL_ARRAY_BUFFER_BINDING
</constant>) is saved as texture coordinate vertex array
96 client-side state (
<constant>GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING
</constant>).
99 When a texture coordinate array is specified,
100 <parameter>size
</parameter>,
<parameter>type
</parameter>,
<parameter>stride
</parameter>, and
<parameter>pointer
</parameter> are saved as client-side
101 state, in addition to the current vertex array buffer object binding.
104 To enable and disable a texture coordinate array, call
<citerefentry><refentrytitle>glEnableClientState
</refentrytitle></citerefentry> and
105 <citerefentry><refentrytitle>glDisableClientState
</refentrytitle></citerefentry> with the argument
106 <constant>GL_TEXTURE_COORD_ARRAY
</constant>. If enabled, the texture coordinate array is used when
107 <citerefentry><refentrytitle>glArrayElement
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawArrays
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMultiDrawArrays
</refentrytitle></citerefentry>,
108 <citerefentry><refentrytitle>glDrawElements
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMultiDrawElements
</refentrytitle></citerefentry>, or
<citerefentry><refentrytitle>glDrawRangeElements
</refentrytitle></citerefentry>
112 <refsect1 id=
"notes"><title>Notes
</title>
114 <function>glTexCoordPointer
</function> is available only if the GL version is
1.1 or greater.
117 For OpenGL versions
1.3 and greater, or when the
<code>ARB_multitexture
</code>
118 extension is supported,
<function>glTexCoordPointer
</function> updates the
119 texture coordinate array state of the active client texture unit,
120 specified with
<citerefentry><refentrytitle>glClientActiveTexture
</refentrytitle></citerefentry>.
123 Each texture coordinate array is initially disabled and isn't accessed when
124 <citerefentry><refentrytitle>glArrayElement
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElements
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElements
</refentrytitle></citerefentry>,
125 <citerefentry><refentrytitle>glDrawArrays
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMultiDrawArrays
</refentrytitle></citerefentry>, or
<citerefentry><refentrytitle>glMultiDrawElements
</refentrytitle></citerefentry>
129 Execution of
<function>glTexCoordPointer
</function> is not allowed between the execution of
130 <citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry> and the corresponding execution of
<citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>,
131 but an error may or may not be generated. If no error is generated,
132 the operation is undefined.
135 <function>glTexCoordPointer
</function> is typically implemented on the client side.
138 Texture coordinate array parameters are client-side state and are therefore
139 not saved or restored by
<citerefentry><refentrytitle>glPushAttrib
</refentrytitle></citerefentry> and
<citerefentry><refentrytitle>glPopAttrib
</refentrytitle></citerefentry>.
140 Use
<citerefentry><refentrytitle>glPushClientAttrib
</refentrytitle></citerefentry> and
141 <citerefentry><refentrytitle>glPopClientAttrib
</refentrytitle></citerefentry> instead.
144 <refsect1 id=
"errors"><title>Errors
</title>
146 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>size
</parameter> is not
1,
2,
3, or
4.
149 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>type
</parameter> is not an accepted value.
152 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>stride
</parameter> is negative.
155 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
157 <citerefentry><refentrytitle>glIsEnabled
</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_COORD_ARRAY
</constant>
160 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_COORD_ARRAY_SIZE
</constant>
163 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_COORD_ARRAY_TYPE
</constant>
166 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_COORD_ARRAY_STRIDE
</constant>
169 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING
</constant>
172 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_ARRAY_BUFFER_BINDING
</constant>
175 <citerefentry><refentrytitle>glGetPointerv
</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_COORD_ARRAY_POINTER
</constant>
178 <refsect1 id=
"seealso"><title>See Also
</title>
180 <citerefentry><refentrytitle>glArrayElement
</refentrytitle></citerefentry>,
181 <citerefentry><refentrytitle>glBindBuffer
</refentrytitle></citerefentry>,
182 <citerefentry><refentrytitle>glClientActiveTexture
</refentrytitle></citerefentry>,
183 <citerefentry><refentrytitle>glColorPointer
</refentrytitle></citerefentry>,
184 <citerefentry><refentrytitle>glDisableClientState
</refentrytitle></citerefentry>,
185 <citerefentry><refentrytitle>glDrawArrays
</refentrytitle></citerefentry>,
186 <citerefentry><refentrytitle>glDrawElements
</refentrytitle></citerefentry>,
187 <citerefentry><refentrytitle>glDrawRangeElements
</refentrytitle></citerefentry>,
188 <citerefentry><refentrytitle>glEdgeFlagPointer
</refentrytitle></citerefentry>,
189 <citerefentry><refentrytitle>glEnableClientState
</refentrytitle></citerefentry>,
190 <citerefentry><refentrytitle>glFogCoordPointer
</refentrytitle></citerefentry>,
191 <citerefentry><refentrytitle>glIndexPointer
</refentrytitle></citerefentry>,
192 <citerefentry><refentrytitle>glInterleavedArrays
</refentrytitle></citerefentry>,
193 <citerefentry><refentrytitle>glMultiDrawArrays
</refentrytitle></citerefentry>,
194 <citerefentry><refentrytitle>glMultiDrawElements
</refentrytitle></citerefentry>,
195 <citerefentry><refentrytitle>glMultiTexCoord
</refentrytitle></citerefentry>,
196 <citerefentry><refentrytitle>glNormalPointer
</refentrytitle></citerefentry>,
197 <citerefentry><refentrytitle>glPopClientAttrib
</refentrytitle></citerefentry>,
198 <citerefentry><refentrytitle>glPushClientAttrib
</refentrytitle></citerefentry>,
199 <citerefentry><refentrytitle>glSecondaryColorPointer
</refentrytitle></citerefentry>,
200 <citerefentry><refentrytitle>glTexCoord
</refentrytitle></citerefentry>,
201 <citerefentry><refentrytitle>glVertexAttribPointer
</refentrytitle></citerefentry>,
202 <citerefentry><refentrytitle>glVertexPointer
</refentrytitle></citerefentry>
205 <refsect1 id=
"Copyright"><title>Copyright
</title>
207 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
208 Silicon Graphics, Inc. This document is licensed under the SGI
209 Free Software B License. For details, see
210 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.