rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / xhtml / glPolygonStipple.xml
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
2 <!-- saved from url=(0013)about:internet -->
3 <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>glPolygonStipple</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glPolygonStipple"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glPolygonStipple — set the polygon stippling pattern</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glPolygonStipple</b>(</code></td><td>const GLubyte *  </td><td><var class="pdparam">pattern</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>pattern</code></em></span></dt><dd><p>
4 Specifies a pointer to a
5 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
6
7 <mml:mrow>
8 <mml:mn>32</mml:mn>
9 <mml:mo>×</mml:mo>
10 <mml:mn>32</mml:mn>
11 </mml:mrow>
12 </mml:math>
13 stipple pattern that will be unpacked
14 from memory in the same way that <a class="citerefentry" href="glDrawPixels.xml"><span class="citerefentry"><span class="refentrytitle">glDrawPixels</span></span></a> unpacks pixels.
15 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
16 Polygon stippling,
17 like line stippling
18 (see <a class="citerefentry" href="glLineStipple.xml"><span class="citerefentry"><span class="refentrytitle">glLineStipple</span></span></a>),
19 masks out certain fragments produced by rasterization,
20 creating a pattern.
21 Stippling is independent of polygon antialiasing.
22 </p><p>
23 <em class="parameter"><code>pattern</code></em> is a pointer to a
24 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
25
26 <mml:mrow>
27 <mml:mn>32</mml:mn>
28 <mml:mo>×</mml:mo>
29 <mml:mn>32</mml:mn>
30 </mml:mrow>
31 </mml:math>
32 stipple pattern that is stored
33 in memory just like the pixel data supplied to a <a class="citerefentry" href="glDrawPixels.xml"><span class="citerefentry"><span class="refentrytitle">glDrawPixels</span></span></a>
34 call with
35 <span class="emphasis"><em></em></span>
36 height
37 and
38 <span class="emphasis"><em>width</em></span>
39 both equal to 32, a pixel format
40 of <code class="constant">GL_COLOR_INDEX</code>, and data type
41 of <code class="constant">GL_BITMAP</code>.
42 That is,
43 the stipple pattern is represented as a
44 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
45
46 <mml:mrow>
47 <mml:mn>32</mml:mn>
48 <mml:mo>×</mml:mo>
49 <mml:mn>32</mml:mn>
50 </mml:mrow>
51 </mml:math>
52 array
53 of 1-bit color indices packed in unsigned bytes.
54 <a class="citerefentry" href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a> parameters like <code class="constant">GL_UNPACK_SWAP_BYTES</code>
55 and <code class="constant">GL_UNPACK_LSB_FIRST</code> affect the assembling of the bits into a
56 stipple pattern.
57 Pixel transfer operations
58 (shift, offset, pixel map)
59 are not applied to the stipple image,
60 however.
61 </p><p>
62 If a non-zero named buffer object is bound to the <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target
63 (see <a class="citerefentry" href="glBindBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glBindBuffer</span></span></a>) while a stipple pattern is
64 specified, <em class="parameter"><code>pattern</code></em> is treated as a byte offset into the buffer object's data store.
65 </p><p>
66 To enable and disable polygon stippling, call
67 <a class="citerefentry" href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a> and <a class="citerefentry" href="glDisable.xml"><span class="citerefentry"><span class="refentrytitle">glDisable</span></span></a>
68 with argument <code class="constant">GL_POLYGON_STIPPLE</code>. Polygon stippling is initially
69 disabled. If it's enabled,
70 a rasterized polygon fragment with window coordinates
71 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
72
73 <mml:msub><mml:mi mathvariant="italic">x</mml:mi>
74 <mml:mi mathvariant="italic">w</mml:mi>
75 </mml:msub>
76 </mml:math>
77 and
78 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
79
80 <mml:msub><mml:mi mathvariant="italic">y</mml:mi>
81 <mml:mi mathvariant="italic">w</mml:mi>
82 </mml:msub>
83 </mml:math>
84 is sent to the next stage of the GL if and only if the
85 (<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
86
87 <mml:mrow>
88 <mml:msub><mml:mi mathvariant="italic">x</mml:mi>
89 <mml:mi mathvariant="italic">w</mml:mi>
90 </mml:msub>
91 <mml:mo>%</mml:mo>
92 <mml:mn>32</mml:mn>
93 </mml:mrow>
94 </mml:math>)th
95 bit in the
96 (<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
97
98 <mml:mrow>
99 <mml:msub><mml:mi mathvariant="italic">y</mml:mi>
100 <mml:mi mathvariant="italic">w</mml:mi>
101 </mml:msub>
102 <mml:mo>%</mml:mo>
103 <mml:mn>32</mml:mn>
104 </mml:mrow>
105 </mml:math>)th
106 row
107 of the stipple pattern is 1 (one).
108 When polygon stippling is disabled, it is as if the stipple pattern
109 consists of all 1's.
110 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
111 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
112 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the buffer object's data store is currently mapped.
113 </p><p>
114 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
115 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the data would be unpacked from the buffer
116 object such that the memory reads required would exceed the data store size.
117 </p><p>
118 <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glPolygonStipple</code>
119 is executed between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a>
120 and the corresponding execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>.
121 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
122 <a class="citerefentry" href="glGetPolygonStipple.xml"><span class="citerefentry"><span class="refentrytitle">glGetPolygonStipple</span></span></a>
123 </p><p>
124 <a class="citerefentry" href="glIsEnabled.xml"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a> with argument <code class="constant">GL_POLYGON_STIPPLE</code>
125 </p><p>
126 <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PIXEL_UNPACK_BUFFER_BINDING</code>
127 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
128 <a class="citerefentry" href="glDrawPixels.xml"><span class="citerefentry"><span class="refentrytitle">glDrawPixels</span></span></a>,
129 <a class="citerefentry" href="glLineStipple.xml"><span class="citerefentry"><span class="refentrytitle">glLineStipple</span></span></a>,
130 <a class="citerefentry" href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>,
131 <a class="citerefentry" href="glPixelTransfer.xml"><span class="citerefentry"><span class="refentrytitle">glPixelTransfer</span></span></a>
132 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
133 Copyright <span class="trademark"></span>© 1991-2006
134 Silicon Graphics, Inc. This document is licensed under the SGI
135 Free Software B License. For details, see
136 <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
137 </p></div></div></body></html>