5a3337a1393ca2bbbf75e4998371c401ae169bdd
[clinton/guile-figl.git] / upstream-man-pages / man2 / xhtml / glLineWidth.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>glLineWidth</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glLineWidth"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glLineWidth — specify the width of rasterized lines</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">glLineWidth</b>(</code></td><td>GLfloat  </td><td><var class="pdparam">width</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>width</code></em></span></dt><dd><p>
4 Specifies the width of rasterized lines.
5 The initial value is 1.
6 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
7 <code class="function">glLineWidth</code> specifies the rasterized width of both aliased and antialiased
8 lines.
9 Using a line width other than 1 has different effects,
10 depending on whether line antialiasing is enabled.
11 To enable and disable line antialiasing, call
12 <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>
13 with argument <code class="constant">GL_LINE_SMOOTH</code>. Line antialiasing is initially
14 disabled.
15 </p><p>
16 If line antialiasing is disabled,
17 the actual width is determined by rounding the supplied width
18 to the nearest integer.
19 (If the rounding results in the value 0,
20 it is as if the line width were 1.)
21 If
22 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
23
24 <mml:mrow>
25 <mml:mfenced open="&#x2223;" close="&#x2223;">
26 <mml:mrow>
27 <mml:mo>Δ</mml:mo>
28 <mml:mi mathvariant="italic">x</mml:mi>
29 </mml:mrow>
30 </mml:mfenced>
31 <mml:mo>&gt;=</mml:mo>
32 <mml:mfenced open="&#x2223;" close="&#x2223;">
33 <mml:mrow>
34 <mml:mo>Δ</mml:mo>
35 <mml:mi mathvariant="italic">y</mml:mi>
36 </mml:mrow>
37 </mml:mfenced>
38 </mml:mrow>
39 </mml:math>,
40 <span class="emphasis"><em>i</em></span> pixels are filled in each column that is rasterized,
41 where <span class="emphasis"><em>i</em></span> is the rounded value of <em class="parameter"><code>width</code></em>.
42 Otherwise,
43 <span class="emphasis"><em>i</em></span> pixels are filled in each row that is rasterized.
44 </p><p>
45 If antialiasing is enabled,
46 line rasterization produces a fragment for each pixel square
47 that intersects the region lying within the rectangle having width
48 equal to the current line width,
49 length equal to the actual length of the line,
50 and centered on the mathematical line segment.
51 The coverage value for each fragment is the window coordinate area
52 of the intersection of the rectangular region with the corresponding
53 pixel square.
54 This value is saved and used in the final rasterization step.
55 </p><p>
56 Not all widths can be supported when line antialiasing is enabled. If an
57 unsupported width is requested, the nearest supported width is used.
58 Only width 1 is guaranteed to be supported; others depend on the
59 implementation. Likewise, there is a range for aliased line widths as well.
60 To query the range of supported widths and the size
61 difference between supported widths within the range, call <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a>
62 with arguments <code class="constant">GL_ALIASED_LINE_WIDTH_RANGE</code>,
63 <code class="constant">GL_SMOOTH_LINE_WIDTH_RANGE</code>, and <code class="constant">GL_SMOOTH_LINE_WIDTH_GRANULARITY</code>.
64 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
65 The line width specified by <code class="function">glLineWidth</code> is always returned when <code class="constant">GL_LINE_WIDTH</code>
66 is queried.
67 Clamping and rounding for aliased and antialiased lines have no effect on the specified value.
68 </p><p>
69 Nonantialiased line width may be clamped to an implementation-dependent maximum. Call <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with <code class="constant">GL_ALIASED_LINE_WIDTH_RANGE</code> to determine the maximum width.
70 </p><p>
71 In OpenGL 1.2, the tokens <code class="constant">GL_LINE_WIDTH_RANGE</code> and <code class="constant">GL_LINE_WIDTH_GRANULARITY</code> were replaced by <code class="constant">GL_ALIASED_LINE_WIDTH_RANGE</code>,
72 <code class="constant">GL_SMOOTH_LINE_WIDTH_RANGE</code>, and <code class="constant">GL_SMOOTH_LINE_WIDTH_GRANULARITY</code>. The old names are retained for backward compatibility, but should not be used in new code.
73 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
74 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>width</code></em> is less than or equal to 0.
75 </p><p>
76 <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glLineWidth</code>
77 is executed between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a>
78 and the corresponding execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>.
79 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
80 <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_LINE_WIDTH</code>
81 </p><p>
82 <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_ALIASED_LINE_WIDTH_RANGE</code>
83 </p><p>
84 <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_SMOOTH_LINE_WIDTH_RANGE</code>
85 </p><p>
86 <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_SMOOTH_LINE_WIDTH_GRANULARITY</code>
87 </p><p>
88 <a class="citerefentry" href="glIsEnabled.xml"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a> with argument <code class="constant">GL_LINE_SMOOTH</code>
89 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
90 <a class="citerefentry" href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a>
91 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
92 Copyright <span class="trademark"></span>© 1991-2006
93 Silicon Graphics, Inc. This document is licensed under the SGI
94 Free Software B License. For details, see
95 <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
96 </p></div></div></body></html>