 %mathent; ]>

<!-- Converted by db4-upgrade version 1.1 -->

<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="glReadBuffer">
    <info>
        <copyright>
            <year>1991-2006</year>
            <holder>Silicon Graphics, Inc.</holder>
        </copyright>
        <copyright>
            <year>2011-2013</year>
            <holder>Khronos Group</holder>
        </copyright>
    </info>
    <refmeta>
        <refentrytitle>glReadBuffer</refentrytitle>
        <manvolnum>3G</manvolnum>
    </refmeta>
    <refnamediv>
        <refname>glReadBuffer</refname>
        <refpurpose>select a color buffer source for pixels</refpurpose>
    </refnamediv>
    <refsynopsisdiv><title>C Specification</title>
        <funcsynopsis>
            <funcprototype>
                <funcdef>void <function>glReadBuffer</function></funcdef>
                <paramdef>GLenum <parameter>mode</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1 xml:id="parameters"><title>Parameters</title>
        <variablelist>
        <varlistentry>
            <term><parameter>mode</parameter></term>
            <listitem>
                <para>
                    Specifies a color buffer.
                    Accepted values are
                    <constant>GL_FRONT_LEFT</constant>,
                    <constant>GL_FRONT_RIGHT</constant>,
                    <constant>GL_BACK_LEFT</constant>,
                    <constant>GL_BACK_RIGHT</constant>,
                    <constant>GL_FRONT</constant>,
                    <constant>GL_BACK</constant>,
                    <constant>GL_LEFT</constant>,
                    <constant>GL_RIGHT</constant>, and the constants
                    <constant>GL_COLOR_ATTACHMENT</constant><emphasis>i</emphasis>.
                </para>
            </listitem>
        </varlistentry>
        </variablelist>
    </refsect1>
    <refsect1 xml:id="description"><title>Description</title>
        <para>
            <function>glReadBuffer</function> specifies a color buffer as the source for subsequent
            <citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>, and
            <citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry> commands.
            <parameter>mode</parameter> accepts one of twelve or more predefined values.
            In a fully configured system,
            <constant>GL_FRONT</constant>,
            <constant>GL_LEFT</constant>, and
            <constant>GL_FRONT_LEFT</constant> all name the front left buffer,
            <constant>GL_FRONT_RIGHT</constant> and
            <constant>GL_RIGHT</constant> name the front right buffer, and
            <constant>GL_BACK_LEFT</constant> and
            <constant>GL_BACK</constant> name the back left buffer.
            Further more, the constants <constant>GL_COLOR_ATTACHMENT</constant><emphasis>i</emphasis> may be used to indicate the
            <emphasis>i</emphasis><superscript>th</superscript> color attachment where <emphasis>i</emphasis> ranges from zero to the
            value of <constant>GL_MAX_COLOR_ATTACHMENTS</constant> minus one.
        </para>
        <para>
            Nonstereo double-buffered configurations have only a front left and a
            back left buffer.
            Single-buffered configurations have a front left and a front right
            buffer if stereo, and only a front left buffer if nonstereo.
            It is an error to specify a nonexistent buffer to <function>glReadBuffer</function>.
        </para>
        <para>
            <parameter>mode</parameter> is initially <constant>GL_FRONT</constant> in single-buffered configurations
            and <constant>GL_BACK</constant> in double-buffered configurations.
        </para>
    </refsect1>
    <refsect1 xml:id="errors"><title>Errors</title>
        <para>
            <constant>GL_INVALID_ENUM</constant> is generated if <parameter>mode</parameter> is not one of the twelve
            (or more) accepted values.
        </para>
        <para>
            <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>mode</parameter> specifies a buffer
            that does not exist.
        </para>
    </refsect1>
    <refsect1 xml:id="associatedgets"><title>Associated Gets</title>
        <para>
            <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_READ_BUFFER</constant>
        </para>
    </refsect1>
    <refsect1 xml:id="seealso"><title>See Also</title>
        <para>
            <citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glDrawBuffer</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry>
        </para>
    </refsect1>
    <refsect1 xml:id="Copyright"><title>Copyright</title>
        <para>
            Copyright <trademark class="copyright"/> 1991-2006 Silicon Graphics, Inc.
            Copyright <trademark class="copyright"/> 2011-2013 Khronos Group.
            This document is licensed under the SGI
            Free Software B License. For details, see
            <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</link>.
        </para>
    </refsect1>
</refentry>
