forked from BSVino/docs.gl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
glLineWidth.xhtml
68 lines (68 loc) · 5.85 KB
/
glLineWidth.xhtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<div class="refentry" title="glLineWidth"><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" title="C Specification"><h2>C Specification</h2><div class="funcsynopsis"><table class="funcprototype-table"><tr><td><code class="funcdef">void <b class="fsfunc">glLineWidth</b>(</code></td><td>GLfloat <var class="pdparam">width</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div><table class="funcprototype-table"><tr><td><code class="funcdef">void <b class="fsfunc">glLineWidthx</b>(</code></td><td>GLfixed <var class="pdparam">width</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1" title="Parameters"><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>Specifies the width of rasterized lines. The
initial value is 1.</p></dd></dl></div></div><div class="refsect1" title="Description"><a id="description"></a><h2>Description</h2><p>
<code class="function">glLineWidth</code>
specifies the rasterized width of both aliased and antialiased
lines. Using a line width other than 1 has different effects,
depending on whether line antialiasing is enabled. To enable
and disable line antialiasing, call
<a class="citerefentry" href="glEnable"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a> and
<a class="citerefentry" href="glDisable"><span class="citerefentry"><span class="refentrytitle">glDisable</span></span></a>
with argument <code class="constant">GL_LINE_SMOOTH</code>.
Line antialiasing is initially disabled.</p><p>If line antialiasing is disabled, the actual width is
determined by rounding the supplied width to the nearest
integer. (If the rounding results in the value 0, it is as if
the line width were 1.) If
<math overflow="scroll">
<mrow>
<mo>|</mo>
<mrow><mo>Δ</mo><mi>x</mi></mrow>
<mo>|</mo>
</mrow>
<mo>>=</mo>
<mrow>
<mo>|</mo>
<mrow><mo>Δ</mo><mi>y</mi></mrow>
<mo>|</mo>
</mrow>
</math>,
<em class="parameter"><code>i</code></em>
pixels are filled in each column that is rasterized, where
<em class="parameter"><code>i</code></em> is the rounded value of
<em class="parameter"><code>width</code></em>. Otherwise, <em class="parameter"><code>i</code></em>
pixels are filled in each row that is rasterized.</p><p>If antialiasing is enabled, line rasterization produces a
fragment for each pixel square that intersects the region lying
within the rectangle having width equal to the current line
width, length equal to the actual length of the line, and
centered on the mathematical line segment. The coverage value
for each fragment is the window coordinate area of the
intersection of the rectangular region with the corresponding
pixel square. This value is saved and used in the final
rasterization step.</p><p>Not all widths can be supported when line antialiasing is
enabled. If an unsupported width is requested, the nearest
supported width is used. Only width 1 is guaranteed to be
supported; others depend on the implementation. Likewise, there
is a range for aliased line widths as well. To query the range
of supported widths, call
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a>
with arguments
<code class="constant">GL_ALIASED_LINE_WIDTH_RANGE</code> or
<code class="constant">GL_SMOOTH_LINE_WIDTH_RANGE</code>.</p></div><div class="refsect1" title="Notes"><a id="notes"></a><h2>Notes</h2><p>Nonantialiased line width may be clamped to an
implementation-dependent maximum. Call
<a class="citerefentry" href="glGet"><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.</p></div><div class="refsect1" title="Errors"><a id="errors"></a><h2>Errors</h2><p><code class="constant">GL_INVALID_VALUE</code> is generated if
<em class="parameter"><code>width</code></em> is less than or equal to 0.</p></div><div class="refsect1" title="Associated Gets"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a>
with argument <code class="constant">GL_ALIASED_LINE_WIDTH_RANGE</code></p><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a>
with argument <code class="constant">GL_SMOOTH_LINE_WIDTH_RANGE</code></p></div><div class="refsect1" title="See Also"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glEnable"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a>,
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a>
</p></div><div class="refsect1" title="Copyright"><a id="copyright"></a><h2>Copyright</h2><p>
Copyright © 2003-2004
Silicon Graphics, Inc. This document is licensed under the SGI
Free Software B License. For details, see
<a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
</p></div></div>