<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
<!-- saved from url=(0013)about:internet -->
<?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>glRenderMode</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glRenderMode"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glRenderMode — set rasterization mode</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">GLint <b class="fsfunc">glRenderMode</b>(</code></td><td>GLenum  </td><td><var class="pdparam">mode</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>mode</code></em></span></dt><dd><p>
                    Specifies the rasterization mode.
                    Three values are accepted:
                    <code class="constant">GL_RENDER</code>,
                    <code class="constant">GL_SELECT</code>, and
                    <code class="constant">GL_FEEDBACK</code>.
                    The initial value is <code class="constant">GL_RENDER</code>.
                </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
            <code class="function">glRenderMode</code> sets the rasterization mode.
            It takes one argument,
            <em class="parameter"><code>mode</code></em>,
            which can assume one of three predefined values:
        </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_RENDER</code></span></dt><dd><p>
                        Render mode. Primitives are rasterized,
                        producing pixel fragments,
                        which are written into the frame buffer.
                        This is the normal mode
                        and also the default mode.
                    </p></dd><dt><span class="term"><code class="constant">GL_SELECT</code></span></dt><dd><p>
                        Selection mode.
                        No pixel fragments are produced,
                        and no change to the frame buffer contents is made.
                        Instead,
                        a record of the names of primitives that would have been drawn
                        if the render mode had been <code class="constant">GL_RENDER</code> is returned in a select buffer,
                        which must be created (see <a class="citerefentry" href="glSelectBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glSelectBuffer</span></span></a>) before selection mode
                        is entered.
                    </p></dd><dt><span class="term"><code class="constant">GL_FEEDBACK</code></span></dt><dd><p>
                        Feedback mode.
                        No pixel fragments are produced,
                        and no change to the frame buffer contents is made.
                        Instead,
                        the coordinates and attributes of vertices that would have been drawn
                        if the render mode had been <code class="constant">GL_RENDER</code> is returned in a feedback buffer,
                        which must be created (see <a class="citerefentry" href="glFeedbackBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glFeedbackBuffer</span></span></a>) before feedback mode
                        is entered.
                    </p></dd></dl></div><p>
            The return value of <code class="function">glRenderMode</code> is determined by the render mode at the time
            <code class="function">glRenderMode</code> is called,
            rather than by <em class="parameter"><code>mode</code></em>.
            The values returned for the three render modes are as follows:
        </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_RENDER</code></span></dt><dd><p>
                        0.
                    </p></dd><dt><span class="term"><code class="constant">GL_SELECT</code></span></dt><dd><p>
                        The number of hit records transferred to the select buffer.
                    </p></dd><dt><span class="term"><code class="constant">GL_FEEDBACK</code></span></dt><dd><p>
                        The number of values (not vertices) transferred to the feedback buffer.
                    </p></dd></dl></div><p>
            See the <a class="citerefentry" href="glSelectBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glSelectBuffer</span></span></a> and <a class="citerefentry" href="glFeedbackBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glFeedbackBuffer</span></span></a> reference pages for
            more details concerning selection and feedback operation.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
            If an error is generated,
            <code class="function">glRenderMode</code> returns 0 regardless of the current render mode.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
            <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>mode</code></em> is not one of the three
            accepted values.
        </p><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if <a class="citerefentry" href="glSelectBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glSelectBuffer</span></span></a> is called
            while the render mode is <code class="constant">GL_SELECT</code>,
            or if <code class="function">glRenderMode</code> is called with argument <code class="constant">GL_SELECT</code> before
            <a class="citerefentry" href="glSelectBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glSelectBuffer</span></span></a> is called at least once.
        </p><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if <a class="citerefentry" href="glFeedbackBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glFeedbackBuffer</span></span></a> is called
            while the render mode is <code class="constant">GL_FEEDBACK</code>,
            or if <code class="function">glRenderMode</code> is called with argument <code class="constant">GL_FEEDBACK</code> before
            <a class="citerefentry" href="glFeedbackBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glFeedbackBuffer</span></span></a> is called at least once.
        </p><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glRenderMode</code>
            is executed between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a>
            and the corresponding execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
            <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_RENDER_MODE</code>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
            <a class="citerefentry" href="glFeedbackBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glFeedbackBuffer</span></span></a>,
            <a class="citerefentry" href="glInitNames.xml"><span class="citerefentry"><span class="refentrytitle">glInitNames</span></span></a>,
            <a class="citerefentry" href="glLoadName.xml"><span class="citerefentry"><span class="refentrytitle">glLoadName</span></span></a>,
            <a class="citerefentry" href="glPassThrough.xml"><span class="citerefentry"><span class="refentrytitle">glPassThrough</span></span></a>,
            <a class="citerefentry" href="glPushName.xml"><span class="citerefentry"><span class="refentrytitle">glPushName</span></span></a>,
            <a class="citerefentry" href="glSelectBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glSelectBuffer</span></span></a>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
            Copyright <span class="trademark"></span>© 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
        </p></div></div></body></html>
