<?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>glPolygonMode</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="glPointSize.3G.xml" title="glPointSize"/><link rel="next" href="glPolygonOffset.3G.xml" title="glPolygonOffset"/></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">glPolygonMode</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glPointSize.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glPolygonOffset.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glPolygonMode.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glPolygonMode.3G-name"/><h2>Name</h2><p>glPolygonMode &#8212; select a polygon rasterization mode</p></div><div class="refsynopsisdiv"><a name="glPolygonMode.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>glPolygonMode</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum <i><tt>face</tt></i>, GLenum <i><tt>mode</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glPolygonMode.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glPolygonMode</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>face</tt></i>, <i><tt>mode</tt></i>) &#8594; <tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glPolygonMode.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>face</tt></i></span></dt><dd>
						Specifies the polygons that <i><tt>mode</tt></i> applies to. Must be <tt>GL_FRONT</tt>
						for front-facing polygons, <tt>GL_BACK</tt> for back-facing polygons, or
						<tt>GL_FRONT_AND_BACK</tt> for front- and back-facing polygons.
					</dd><dt><span class="term"><i><tt>mode</tt></i></span></dt><dd>
						Specifies how polygons will be rasterized. Accepted values are <tt>GL_POINT</tt>,
						<tt>GL_LINE</tt>, and <tt>GL_FILL</tt>. The initial value is
						<tt>GL_FILL</tt> for both front- and back-facing polygons.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glPolygonMode.3G-description"/><h2>Description</h2><p>
			<tt>glPolygonMode</tt> controls the interpretation of polygons for rasterization.
			<i><tt>face</tt></i> describes which polygons <i><tt>mode</tt></i> applies to: front-facing polygons
			(<tt>GL_FRONT</tt>), back-facing polygons (<tt>GL_BACK</tt>), or both
			(<tt>GL_FRONT_AND_BACK</tt>). The polygon mode affects only the final rasterization of polygons. In
			particular, a polygon's vertices are lit and the polygon is clipped and possibly culled before these modes are applied.
		</p><p>
			Three modes are defined and can be specified in <i><tt>mode</tt></i>:
		</p><div class="variablelist"><dl><dt><span class="term"><tt>GL_POINT</tt></span></dt><dd>
						Polygon vertices that are marked as the start of a boundary edge are drawn as points. Point attributes such
						as <tt>GL_POINT_SIZE</tt> and <tt>GL_POINT_SMOOTH</tt> control the rasterization of
						the points. Polygon rasterization attributes other than <tt>GL_POLYGON_MODE</tt> have no
						effect.
					</dd><dt><span class="term"><tt>GL_LINE</tt></span></dt><dd>
						Boundary edges of the polygon are drawn as line segments. They are treated as connected line segments for
						line stippling; the line stipple counter and pattern are not reset between segments (see <a href="glLineStipple.3G.xml">glLineStipple</a>). Line attributes such as <tt>GL_LINE_WIDTH</tt> and
						<tt>GL_LINE_SMOOTH</tt> control the rasterization of the lines. Polygon rasterization
						attributes other than <tt>GL_POLYGON_MODE</tt> have no effect.
					</dd><dt><span class="term"><tt>GL_FILL</tt></span></dt><dd>
						The interior of the polygon is filled. Polygon attributes such as <tt>GL_POLYGON_STIPPLE</tt>
						and <tt>GL_POLYGON_SMOOTH</tt> control the rasterization of the polygon.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glPolygonMode.3G-examples"/><h2>Examples</h2><p>
			To draw a surface with filled back-facing polygons and outlined front-facing polygons, call
			glPolygonMode(<tt>GL_FRONT</tt>, <tt>GL_LINE</tt>);
		</p></div><div class="refsect1" lang="en"><a name="glPolygonMode.3G-notes"/><h2>Notes</h2><p>
			Vertices are marked as boundary or nonboundary with an edge flag. Edge flags are generated internally by the GL when it
			decomposes polygons; they can be set explicitly using <a href="glEdgeFlag.3G.xml"><tt>glEdgeFlag</tt></a>.
		</p></div><div class="refsect1" lang="en"><a name="glPolygonMode.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_ENUM</tt> is generated if either <i><tt>face</tt></i> or <i><tt>mode</tt></i>
			is not an accepted value.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glPolygonMode</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="glPolygonMode.3G-associated_gets"/><h2>Associated Gets</h2><p>
			<tt>glGet</tt> with argument <tt>GL_POLYGON_MODE</tt>
		</p></div><div class="refsect1" lang="en"><a name="glPolygonMode.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist"><a href="glBegin.3G.xml">glBegin</a>, <a href="glEdgeFlag.3G.xml">glEdgeFlag</a>, <a href="glLineStipple.3G.xml">glLineStipple</a>, <a href="glLineWidth.3G.xml">glLineWidth</a>, <a href="glPointSize.3G.xml">glPointSize</a>, <a href="glPolygonStipple.3G.xml">glPolygonStipple</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="glPointSize.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="glPolygonOffset.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glPointSize </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glPolygonOffset</td></tr></table></div></body></html>