<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.2//EN" "DTD/docbook/docbookx.dtd">
<!--
License Applicability. Except to the extent portions of this file are
made subject to an alternative license as permitted in the SGI Free
Software License B, Version 1.1 (the "License"), the contents of this
file are subject only to the provisions of the License. You may not use
this file except in compliance with the License. You may obtain a copy
of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
http://oss.sgi.com/projects/FreeB
Note that, as provided in the License, the Software is distributed on an
"AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
Original Code. The Original Code is: OpenGL ES Reference Manual,
Version 1.0, released September 2003, developed by Silicon Graphics,
Inc. The Original Code is Copyright (c) 2003 Silicon Graphics, Inc.
Copyright in any portions created by third parties is as indicated
elsewhere herein. All Rights Reserved.
-->
<refentry id="glTexCoordPointer">
<refmeta>
<refentrytitle>glTexCoordPointer</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glTexCoordPointer</refname>
<refpurpose>define an array of texture coordinates</refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glTexCoordPointer</function></funcdef>
<paramdef>GLint <parameter>size</parameter></paramdef>
<paramdef>GLenum <parameter>type</parameter></paramdef>
<paramdef>GLsizei <parameter>stride</parameter></paramdef>
<paramdef>const GLvoid * <parameter>pointer</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term>
<parameter>size</parameter>
</term>
<listitem>
<para>Specifies the number of coordinates per array
element. Must be 2, 3 or 4. The initial value is 4.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>type</parameter>
</term>
<listitem>
<para>Specifies the data type of each texture coordinate.
Symbolic constants
<constant>GL_BYTE</constant>,
<constant>GL_SHORT</constant>, and
<constant>GL_FIXED</constant> are accepted.
However, the initial value is
<constant>GL_FLOAT</constant>.</para>
<para>
The common profile accepts the symbolic constant
<constant>GL_FLOAT</constant> as well.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>stride</parameter>
</term>
<listitem>
<para>Specifies the byte offset between consecutive array
elements. If <parameter>stride</parameter>
is 0, the array elements are understood to be tightly
packed. The initial value is 0.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>pointer</parameter>
</term>
<listitem>
<para>Specifies a pointer to the first coordinate of the
first element in the array. The initial value is 0.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para><function>glTexCoordPointer</function>
specifies the location and data of an array of texture
coordinates to use when rendering. <parameter>size</parameter>
specifies the number of coordinates per element, and must be 2,
3, or 4. <parameter>type</parameter>
specifies the data type of each texture coordinate and
<parameter>stride</parameter>
specifies the byte stride from one array element to the next
allowing vertices and attributes to be packed into a single
array or stored in separate arrays. (Single-array storage may
be more efficient on some implementations.)</para>
<para> When a texture coordinate array is specified,
<parameter>size</parameter>,
<parameter>type</parameter>,
<parameter>stride</parameter>, and
<parameter>pointer</parameter> are saved as client-side state.</para>
<para>
If the texture coordinate array is enabled, it is used when
<citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>,
or
<citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>
is called.
To enable and disable the texture coordinate array for the client-side
active texture unit, call
<citerefentry><refentrytitle>glEnableClientState</refentrytitle></citerefentry>
and
<citerefentry><refentrytitle>glDisableClientState</refentrytitle></citerefentry>
with the argument
<constant>GL_TEXTURE_COORD_ARRAY</constant>.
The texture coordinate array is initially disabled for all client-side
active texture units and isn't accessed when
<citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry> or
<citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>
is called.</para>
<para>Use
<citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>
to construct a sequence of primitives (all of the same type)
from prespecified vertex and vertex attribute arrays. Use
<citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>
to construct a sequence of primitives by indexing vertices and
vertex attributes.</para>
</refsect1>
<refsect1>
<title>Notes</title>
<para>
<function>glTexCoordPointer</function>
is typically implemented on the client side.</para>
<para>
<function>glTexCoordPointer</function>
updates the texture coordinate array state of the client-side active
texture unit, specified with
<citerefentry><refentrytitle>glClientActiveTexture</refentrytitle></citerefentry>.</para>
</refsect1>
<refsect1>
<title>Errors</title>
<para><constant>GL_INVALID_VALUE</constant> is generated if
<parameter>size</parameter> is not 2, 3, or 4.</para>
<para><constant>GL_INVALID_ENUM</constant> is generated if
<parameter>type</parameter> is not an accepted value.</para>
<para><constant>GL_INVALID_VALUE</constant> is generated if
<parameter>stride</parameter> is negative.</para>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>glClientActiveTexture</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColorPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMultiTexCoord</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glNormalPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glVertexPointer</refentrytitle></citerefentry>
</para>
</refsect1>
</refentry>