<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:mml="http://www.w3.org/1998/Math/MathML"
><head><title>glRenderMode</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"/><link rel="home" href="index.xml" title="PyOpenGL 2.0.1.07 Man Pages"/><link rel="up" href="reference-GL.xml" title="GL"/><link rel="previous" href="glRect.3G.xml" title="glRect"/><link rel="next" href="glResetHistogram.3G.xml" title="glResetHistogram"/></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">glRenderMode</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glRect.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glResetHistogram.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glRenderMode.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glRenderMode.3G-name"/><h2>Name</h2><p>glRenderMode &#8212; set rasterization mode</p></div><div class="refsynopsisdiv"><a name="glRenderMode.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>GLint <tt>glRenderMode</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum <i><tt>mode</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glRenderMode.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glRenderMode</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>mode</tt></i>) &#8594; <i><tt>buffer</tt></i></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glRenderMode.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>mode</tt></i></span></dt><dd>
						Specifies the rasterization mode. Three values are accepted: <tt>GL_RENDER</tt>,
						<tt>GL_SELECT</tt>, and <tt>GL_FEEDBACK</tt>. The initial value is
						<tt>GL_RENDER</tt>.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glRenderMode.3G-description"/><h2>Description</h2><p>
			<tt>glRenderMode</tt> sets the rasterization mode. It takes one argument, <i><tt>mode</tt></i>,
			which can assume one of three predefined values:
		</p><div class="variablelist"><dl><dt><span class="term"><tt>GL_RENDER</tt></span></dt><dd>
						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.
					</dd><dt><span class="term"><tt>GL_SELECT</tt></span></dt><dd>
						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
						<tt>GL_RENDER</tt> is returned in a select buffer, which must be created (see <a href="glSelectBuffer.3G.xml">glSelectBuffer</a>) before selection mode is entered.
					</dd><dt><span class="term"><tt>GL_FEEDBACK</tt></span></dt><dd>
						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
						<tt>GL_RENDER</tt> is returned in a feedback buffer, which must be created (see <a href="glFeedbackBuffer.3G.xml">glFeedbackBuffer</a>) before feedback mode is entered.
					</dd></dl></div><p>
			The return value of <tt>glRenderMode</tt> is determined by the render mode at the time
			<tt>glRenderMode</tt> is called, rather than by <i><tt>mode</tt></i>. The values returned for the
			three render modes are as follows:
		</p><div class="variablelist"><dl><dt><span class="term"><tt>GL_RENDER</tt></span></dt><dd>
						0.
					</dd><dt><span class="term"><tt>GL_SELECT</tt></span></dt><dd>
						The number of hit records transferred to the select buffer.
					</dd><dt><span class="term"><tt>GL_FEEDBACK</tt></span></dt><dd>
						The number of values (not vertices) transferred to the feedback buffer.
					</dd></dl></div><p>
			See the <a href="glSelectBuffer.3G.xml"><tt>glSelectBuffer</tt></a> and <a href="glFeedbackBuffer.3G.xml"><tt>glFeedbackBuffer</tt></a> reference pages for more details concerning selection and feedback
			operation.
		</p></div><div class="refsect1" lang="en"><a name="glRenderMode.3G-notes"/><h2>Notes</h2><p>
			If an error is generated, <tt>glRenderMode</tt> returns 0 regardless of the current render mode.
		</p></div><div class="refsect1" lang="en"><a name="glRenderMode.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>mode</tt></i> is not one of the three accepted
			values.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <a href="glSelectBuffer.3G.xml"><tt>glSelectBuffer</tt></a> is
			called while the render mode is <tt>GL_SELECT</tt>, or if <tt>glRenderMode</tt> is called with
			argument <tt>GL_SELECT</tt> before <a href="glSelectBuffer.3G.xml"><tt>glSelectBuffer</tt></a> is called at
			least once.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <a href="glFeedbackBuffer.3G.xml"><tt>glFeedbackBuffer</tt></a> is
			called while the render mode is <tt>GL_FEEDBACK</tt>, or if <tt>glRenderMode</tt> is called
			with argument <tt>GL_FEEDBACK</tt> before <a href="glFeedbackBuffer.3G.xml"><tt>glFeedbackBuffer</tt></a> is
			called at least once.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glRenderMode</tt> is executed between the
			execution of <a href="glBegin.3G.xml"><tt>glBegin</tt></a> and the corresponding execution of <a href="glBegin.3G.xml"><tt>glEnd</tt></a>.
		</p></div><div class="refsect1" lang="en"><a name="glRenderMode.3G-associated_gets"/><h2>Associated Gets</h2><p>
			<tt>glGet</tt> with argument <tt>GL_RENDER_MODE</tt>
		</p></div><div class="refsect1" lang="en"><a name="glRenderMode.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist"><a href="glFeedbackBuffer.3G.xml">glFeedbackBuffer</a>, <a href="glInitNames.3G.xml">glInitNames</a>, <a href="glLoadName.3G.xml">glLoadName</a>, <a href="glPassThrough.3G.xml">glPassThrough</a>, <a href="glPushName.3G.xml">glPushName</a>, <a href="glSelectBuffer.3G.xml">glSelectBuffer</a></span>
		</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="glRect.3G.xml">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-GL.xml">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="glResetHistogram.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glRect </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glResetHistogram</td></tr></table></div></body></html>