1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id=
"glPolygonMode">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glPolygonMode
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glPolygonMode
</refname>
17 <refpurpose>select a polygon rasterization mode
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glPolygonMode
</function></funcdef>
23 <paramdef>GLenum
<parameter>face
</parameter></paramdef>
24 <paramdef>GLenum
<parameter>mode
</parameter></paramdef>
28 <refsect1 id=
"parameters"><title>Parameters
</title>
31 <term><parameter>face
</parameter></term>
34 Specifies the polygons that
<parameter>mode
</parameter> applies to.
36 <constant>GL_FRONT
</constant> for front-facing polygons,
37 <constant>GL_BACK
</constant> for back-facing polygons,
38 or
<constant>GL_FRONT_AND_BACK
</constant> for front- and back-facing polygons.
43 <term><parameter>mode
</parameter></term>
46 Specifies how polygons will be rasterized.
48 <constant>GL_POINT
</constant>,
49 <constant>GL_LINE
</constant>, and
50 <constant>GL_FILL
</constant>.
51 The initial value is
<constant>GL_FILL
</constant> for both front- and back-facing polygons.
57 <refsect1 id=
"description"><title>Description
</title>
59 <function>glPolygonMode
</function> controls the interpretation of polygons for rasterization.
60 <parameter>face
</parameter> describes which polygons
<parameter>mode
</parameter> applies to:
61 front-facing polygons (
<constant>GL_FRONT
</constant>),
62 back-facing polygons (
<constant>GL_BACK
</constant>),
63 or both (
<constant>GL_FRONT_AND_BACK
</constant>).
64 The polygon mode affects only the final rasterization of polygons.
66 a polygon's vertices are lit and
67 the polygon is clipped and possibly culled before these modes are applied.
70 Three modes are defined and can be specified in
<parameter>mode
</parameter>:
74 <term><constant>GL_POINT
</constant></term>
77 Polygon vertices that are marked as the start of a boundary edge
79 Point attributes such as
80 <constant>GL_POINT_SIZE
</constant> and
81 <constant>GL_POINT_SMOOTH
</constant> control
82 the rasterization of the points.
83 Polygon rasterization attributes other than
<constant>GL_POLYGON_MODE
</constant> have no effect.
88 <term><constant>GL_LINE
</constant></term>
91 Boundary edges of the polygon are drawn as line segments.
92 They are treated as connected line segments for line stippling;
93 the line stipple counter and pattern are not reset between segments
94 (see
<citerefentry><refentrytitle>glLineStipple
</refentrytitle></citerefentry>).
95 Line attributes such as
96 <constant>GL_LINE_WIDTH
</constant> and
97 <constant>GL_LINE_SMOOTH
</constant> control
98 the rasterization of the lines.
99 Polygon rasterization attributes other than
<constant>GL_POLYGON_MODE
</constant> have no effect.
104 <term><constant>GL_FILL
</constant></term>
107 The interior of the polygon is filled.
108 Polygon attributes such as
109 <constant>GL_POLYGON_STIPPLE
</constant> and
110 <constant>GL_POLYGON_SMOOTH
</constant> control the rasterization of the polygon.
116 <refsect1 id=
"examples"><title>Examples
</title>
118 To draw a surface with filled back-facing polygons
119 and outlined front-facing polygons,
122 glPolygonMode(
<constant>GL_FRONT
</constant>,
<constant>GL_LINE
</constant>);
126 <refsect1 id=
"notes"><title>Notes
</title>
128 Vertices are marked as boundary or nonboundary with an edge flag.
129 Edge flags are generated internally by the GL when it decomposes
130 polygons; they can be set explicitly using
<citerefentry><refentrytitle>glEdgeFlag
</refentrytitle></citerefentry>.
133 <refsect1 id=
"errors"><title>Errors
</title>
135 <constant>GL_INVALID_ENUM
</constant> is generated if either
<parameter>face
</parameter> or
<parameter>mode
</parameter> is not
139 <constant>GL_INVALID_OPERATION
</constant> is generated if
<function>glPolygonMode
</function>
140 is executed between the execution of
<citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry>
141 and the corresponding execution of
<citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>.
144 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
146 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_POLYGON_MODE
</constant>
149 <refsect1 id=
"seealso"><title>See Also
</title>
151 <citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry>,
152 <citerefentry><refentrytitle>glEdgeFlag
</refentrytitle></citerefentry>,
153 <citerefentry><refentrytitle>glLineStipple
</refentrytitle></citerefentry>,
154 <citerefentry><refentrytitle>glLineWidth
</refentrytitle></citerefentry>,
155 <citerefentry><refentrytitle>glPointSize
</refentrytitle></citerefentry>,
156 <citerefentry><refentrytitle>glPolygonStipple
</refentrytitle></citerefentry>
159 <refsect1 id=
"Copyright"><title>Copyright
</title>
161 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
162 Silicon Graphics, Inc. This document is licensed under the SGI
163 Free Software B License. For details, see
164 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.