<?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="glInterleavedArrays">
    <refmeta>
        <refmetainfo>
            <copyright>
                <year>1991-2006</year>
                <holder>Silicon Graphics, Inc.</holder>
            </copyright>
        </refmetainfo>
        <refentrytitle>glInterleavedArrays</refentrytitle>
        <manvolnum>3G</manvolnum>
    </refmeta>
    <refnamediv>
        <refname>glInterleavedArrays</refname>
        <refpurpose>simultaneously specify and enable several interleaved arrays</refpurpose>
    </refnamediv>
    <refsynopsisdiv><title>C Specification</title>
        <funcsynopsis>
            <funcprototype>
                <funcdef>void <function>glInterleavedArrays</function></funcdef>
                <paramdef>GLenum <parameter>format</parameter></paramdef>
                <paramdef>GLsizei <parameter>stride</parameter></paramdef>
                <paramdef>const GLvoid * <parameter>pointer</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1 id="parameters"><title>Parameters</title>
        <variablelist>
        <varlistentry>
            <term><parameter>format</parameter></term>
            <listitem>
                <para>
                    Specifies the type of array to enable. Symbolic constants
                    <constant>GL_V2F</constant>,
                    <constant>GL_V3F</constant>,
                    <constant>GL_C4UB_V2F</constant>,
                    <constant>GL_C4UB_V3F</constant>,
                    <constant>GL_C3F_V3F</constant>,
                    <constant>GL_N3F_V3F</constant>,
                    <constant>GL_C4F_N3F_V3F</constant>,
                    <constant>GL_T2F_V3F</constant>,
                    <constant>GL_T4F_V4F</constant>,
                    <constant>GL_T2F_C4UB_V3F</constant>,
                    <constant>GL_T2F_C3F_V3F</constant>,
                    <constant>GL_T2F_N3F_V3F</constant>,
                    <constant>GL_T2F_C4F_N3F_V3F</constant>,
                    and
                    <constant>GL_T4F_C4F_N3F_V4F</constant>
                    are accepted.
                </para>
            </listitem>
        </varlistentry>
        <varlistentry>
            <term><parameter>stride</parameter></term>
            <listitem>
                <para>
                    Specifies the offset in bytes between each aggregate array element.
                </para>
            </listitem>
        </varlistentry>
        </variablelist>
    </refsect1>
    <refsect1 id="description"><title>Description</title>
        <para>
            <function>glInterleavedArrays</function> lets you specify and enable individual color,
            normal,
            texture and vertex
            arrays whose elements are part of a larger aggregate array element.
            For some implementations, this is more efficient than specifying the arrays
            separately.
        </para>
        <para>
            If <parameter>stride</parameter> is 0, the aggregate elements are stored consecutively.
            Otherwise, <parameter>stride</parameter> bytes occur between the beginning of one
            aggregate array element and the beginning of the next aggregate array
            element.
        </para>
        <para>
            <parameter>format</parameter> serves as a ``key''
            describing the extraction of individual arrays from the aggregate array.
            If <parameter>format</parameter> contains a T, then texture coordinates are
            extracted from the interleaved array.  If C is present, color values
            are extracted. If N is present, normal coordinates are extracted.
            Vertex coordinates are always extracted.
        </para>
        <para>
            The digits 2, 3, and 4 denote how many values are extracted.
            F indicates that values are extracted as floating-point values.
            Colors may also be extracted as 4 unsigned bytes if 4UB follows the
            C.  If a color is extracted as 4 unsigned bytes, the vertex
            array element which follows is located at the first possible
            floating-point aligned address.
        </para>
    </refsect1>
    <refsect1 id="notes"><title>Notes</title>
        <para>
            <function>glInterleavedArrays</function> is available only if the GL version is 1.1 or greater.
        </para>
        <para>
            If <function>glInterleavedArrays</function> is called while compiling a display list, it is not
            compiled into the list, and it is executed immediately.
        </para>
        <para>
            Execution of <function>glInterleavedArrays</function> is not allowed between the execution of
            <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>,
            but an error may or may not be generated. If no error is generated,
            the operation is undefined.
        </para>
        <para>
            <function>glInterleavedArrays</function> is typically implemented on the client side.
        </para>
        <para>
            Vertex array parameters are client-side state and are therefore not
            saved or restored by <citerefentry><refentrytitle>glPushAttrib</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glPopAttrib</refentrytitle></citerefentry>.
            Use <citerefentry><refentrytitle>glPushClientAttrib</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glPopClientAttrib</refentrytitle></citerefentry> instead.
        </para>
        <para>
            For OpenGL versions 1.3 and greater, or when the <code>ARB_multitexture</code> extension is supported, <function>glInterleavedArrays</function>
            only updates the texture coordinate array for the client active texture
            unit. The texture coordinate state for other client texture units is not
            updated, regardless of whether the client texture unit is enabled or not.
        </para>
        <para>
            Secondary color values are not supported in interleaved vertex array formats.
        </para>
    </refsect1>
    <refsect1 id="errors"><title>Errors</title>
        <para>
            <constant>GL_INVALID_ENUM</constant> is generated if <parameter>format</parameter> is not an accepted value.
        </para>
        <para>
            <constant>GL_INVALID_VALUE</constant> is generated if <parameter>stride</parameter> is negative.
        </para>
    </refsect1>
    <refsect1 id="seealso"><title>See Also</title>
        <para>
            <citerefentry><refentrytitle>glArrayElement</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glClientActiveTexture</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glColorPointer</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glEdgeFlagPointer</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glEnableClientState</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glGetPointerv</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glIndexPointer</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>
