rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / glPolygonMode.xml
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">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>1991-2006</year>
9 <holder>Silicon Graphics, Inc.</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glPolygonMode</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glPolygonMode</refname>
17 <refpurpose>select a polygon rasterization mode</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glPolygonMode</function></funcdef>
23 <paramdef>GLenum <parameter>face</parameter></paramdef>
24 <paramdef>GLenum <parameter>mode</parameter></paramdef>
25 </funcprototype>
26 </funcsynopsis>
27 </refsynopsisdiv>
28 <refsect1 id="parameters"><title>Parameters</title>
29 <variablelist>
30 <varlistentry>
31 <term><parameter>face</parameter></term>
32 <listitem>
33 <para>
34 Specifies the polygons that <parameter>mode</parameter> applies to.
35 Must be
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.
39 </para>
40 </listitem>
41 </varlistentry>
42 <varlistentry>
43 <term><parameter>mode</parameter></term>
44 <listitem>
45 <para>
46 Specifies how polygons will be rasterized.
47 Accepted values are
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.
52 </para>
53 </listitem>
54 </varlistentry>
55 </variablelist>
56 </refsect1>
57 <refsect1 id="description"><title>Description</title>
58 <para>
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.
65 In particular,
66 a polygon's vertices are lit and
67 the polygon is clipped and possibly culled before these modes are applied.
68 </para>
69 <para>
70 Three modes are defined and can be specified in <parameter>mode</parameter>:
71 </para>
72 <variablelist>
73 <varlistentry>
74 <term><constant>GL_POINT</constant></term>
75 <listitem>
76 <para>
77 Polygon vertices that are marked as the start of a boundary edge
78 are drawn as points.
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.
84 </para>
85 </listitem>
86 </varlistentry>
87 <varlistentry>
88 <term><constant>GL_LINE</constant></term>
89 <listitem>
90 <para>
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.
100 </para>
101 </listitem>
102 </varlistentry>
103 <varlistentry>
104 <term><constant>GL_FILL</constant></term>
105 <listitem>
106 <para>
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.
111 </para>
112 </listitem>
113 </varlistentry>
114 </variablelist>
115 </refsect1>
116 <refsect1 id="examples"><title>Examples</title>
117 <para>
118 To draw a surface with filled back-facing polygons
119 and outlined front-facing polygons,
120 call
121 <programlisting>
122 glPolygonMode(<constant>GL_FRONT</constant>, <constant>GL_LINE</constant>);
123 </programlisting>
124 </para>
125 </refsect1>
126 <refsect1 id="notes"><title>Notes</title>
127 <para>
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>.
131 </para>
132 </refsect1>
133 <refsect1 id="errors"><title>Errors</title>
134 <para>
135 <constant>GL_INVALID_ENUM</constant> is generated if either <parameter>face</parameter> or <parameter>mode</parameter> is not
136 an accepted value.
137 </para>
138 <para>
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>.
142 </para>
143 </refsect1>
144 <refsect1 id="associatedgets"><title>Associated Gets</title>
145 <para>
146 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_POLYGON_MODE</constant>
147 </para>
148 </refsect1>
149 <refsect1 id="seealso"><title>See Also</title>
150 <para>
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>
157 </para>
158 </refsect1>
159 <refsect1 id="Copyright"><title>Copyright</title>
160 <para>
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>.
165 </para>
166 </refsect1>
167 </refentry>