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.
35 Must be
<constant>GL_FRONT_AND_BACK
</constant> for front- and back-facing polygons.
40 <term><parameter>mode
</parameter></term>
43 Specifies how polygons will be rasterized.
45 <constant>GL_POINT
</constant>,
46 <constant>GL_LINE
</constant>, and
47 <constant>GL_FILL
</constant>.
48 The initial value is
<constant>GL_FILL
</constant> for both front- and back-facing polygons.
54 <refsect1 id=
"description"><title>Description
</title>
56 <function>glPolygonMode
</function> controls the interpretation of polygons for rasterization.
57 <parameter>face
</parameter> describes which polygons
<parameter>mode
</parameter> applies to:
58 both front and back-facing polygons (
<constant>GL_FRONT_AND_BACK
</constant>).
59 The polygon mode affects only the final rasterization of polygons.
61 a polygon's vertices are lit and
62 the polygon is clipped and possibly culled before these modes are applied.
65 Three modes are defined and can be specified in
<parameter>mode
</parameter>:
69 <term><constant>GL_POINT
</constant></term>
72 Polygon vertices that are marked as the start of a boundary edge
74 Point attributes such as
75 <constant>GL_POINT_SIZE
</constant> and
76 <constant>GL_POINT_SMOOTH
</constant> control
77 the rasterization of the points.
78 Polygon rasterization attributes other than
<constant>GL_POLYGON_MODE
</constant> have no effect.
83 <term><constant>GL_LINE
</constant></term>
86 Boundary edges of the polygon are drawn as line segments.
87 Line attributes such as
88 <constant>GL_LINE_WIDTH
</constant> and
89 <constant>GL_LINE_SMOOTH
</constant> control
90 the rasterization of the lines.
91 Polygon rasterization attributes other than
<constant>GL_POLYGON_MODE
</constant> have no effect.
96 <term><constant>GL_FILL
</constant></term>
99 The interior of the polygon is filled.
100 Polygon attributes such as
<constant>GL_POLYGON_SMOOTH
</constant> control the rasterization of the polygon.
106 <refsect1 id=
"examples"><title>Examples
</title>
108 To draw a surface with outlined polygons,
111 glPolygonMode(
<constant>GL_FRONT_AND_BACK
</constant>,
<constant>GL_LINE
</constant>);
115 <refsect1 id=
"notes"><title>Notes
</title>
117 Vertices are marked as boundary or nonboundary with an edge flag.
118 Edge flags are generated internally by the GL when it decomposes
119 triangle stips and fans.
122 <refsect1 id=
"errors"><title>Errors
</title>
124 <constant>GL_INVALID_ENUM
</constant> is generated if either
<parameter>face
</parameter> or
<parameter>mode
</parameter> is not
128 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
130 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_POLYGON_MODE
</constant>
133 <refsect1 id=
"seealso"><title>See Also
</title>
135 <citerefentry><refentrytitle>glLineWidth
</refentrytitle></citerefentry>,
136 <citerefentry><refentrytitle>glPointSize
</refentrytitle></citerefentry>
139 <refsect1 id=
"Copyright"><title>Copyright
</title>
141 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
142 Silicon Graphics, Inc. This document is licensed under the SGI
143 Free Software B License. For details, see
144 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.