
<refentry id="glIndexMask">
    <refmeta>
        <refmetainfo>
            <copyright>
                <year>1991-2006</year>
                <holder>Silicon Graphics, Inc.</holder>
            </copyright>
        </refmetainfo>
        <refentrytitle>glIndexMask</refentrytitle>
        <manvolnum>3G</manvolnum>
    </refmeta>
    <refnamediv>
        <refname>glIndexMask</refname>
        <refpurpose>control the writing of individual bits in the color index buffers</refpurpose>
    </refnamediv>
    <refsynopsisdiv><title>C Specification</title>
        <funcsynopsis>
            <funcprototype>
                <funcdef>void <function>glIndexMask</function></funcdef>
                <paramdef>GLuint <parameter>mask</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <!-- eqn: ignoring delim $$ -->
    <refsect1 id="parameters"><title>Parameters</title>
        <variablelist>
        <varlistentry>
            <term><parameter>mask</parameter></term>
            <listitem>
                <para>
                    Specifies a bit mask to enable and disable the writing of individual bits
                    in the color index buffers.
                    Initially, the mask is all 1's.
                </para>
            </listitem>
        </varlistentry>
        </variablelist>
    </refsect1>
    <refsect1 id="description"><title>Description</title>
        <para>
            <function>glIndexMask</function> controls the writing of individual bits in the color index buffers.
            The least significant 
            <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>
            bits of <parameter>mask</parameter>,
            where 
            <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>
            is the number of bits in a color index buffer,
            specify a mask.
            Where a 1 (one) appears in the mask,
            it's possible to write to the corresponding bit in the color index
            buffer (or buffers).
            Where a 0 (zero) appears,
            the corresponding bit is write-protected.
        </para>
        <para>
            This mask is used only in color index mode,
            and it affects only the buffers currently selected for writing
            (see <citerefentry><refentrytitle>glDrawBuffer</refentrytitle></citerefentry>).
            Initially, all bits are enabled for writing.
        </para>
    </refsect1>
    <refsect1 id="errors"><title>Errors</title>
        <para>
            <constant>GL_INVALID_OPERATION</constant> is generated if <function>glIndexMask</function>
            is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
            and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
        </para>
    </refsect1>
    <refsect1 id="associatedgets"><title>Associated Gets</title>
        <para>
            <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_INDEX_WRITEMASK</constant>
        </para>
    </refsect1>
    <refsect1 id="seealso"><title>See Also</title>
        <para>
            <citerefentry><refentrytitle>glColorMask</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glDepthMask</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glDrawBuffer</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glIndex</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glIndexPointer</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glStencilMask</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>
