File: glLineWidth.xml

package info (click to toggle)
khronos-opengl-man4 1.0~svn27841-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 24,888 kB
  • ctags: 377
  • sloc: xml: 188,408; makefile: 1,153; python: 736; sh: 49; php: 7; sed: 2
file content (159 lines) | stat: -rw-r--r-- 8,027 bytes parent folder | download
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
              "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glLineWidth">
    <refentryinfo>
        <copyright>
            <year>1991-2006</year>
            <holder>Silicon Graphics, Inc.</holder>
        </copyright>
        <copyright>
            <year>2010-2013</year>
            <holder>Khronos Group</holder>
        </copyright>
    </refentryinfo>
    <refmeta>
        <refentrytitle>glLineWidth</refentrytitle>
        <manvolnum>3G</manvolnum>
    </refmeta>
    <refnamediv>
        <refname>glLineWidth</refname>
        <refpurpose>specify the width of rasterized lines</refpurpose>
    </refnamediv>
    <refsynopsisdiv><title>C Specification</title>
        <funcsynopsis>
            <funcprototype>
                <funcdef>void <function>glLineWidth</function></funcdef>
                <paramdef>GLfloat <parameter>width</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1 id="parameters"><title>Parameters</title>
        <variablelist>
        <varlistentry>
            <term><parameter>width</parameter></term>
            <listitem>
                <para>
                    Specifies the width of rasterized lines.
                    The initial value is 1.
                </para>
            </listitem>
        </varlistentry>
        </variablelist>
    </refsect1>
    <refsect1 id="description"><title>Description</title>
        <para>
            <function>glLineWidth</function> 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
            <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry>
            with argument <constant>GL_LINE_SMOOTH</constant>. Line antialiasing is initially
            disabled.
        </para>
        <para>
            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
            <inlineequation><mml:math>
                <!-- eqn: | DELTA x |  >=  | DELTA y |:-->
                <!-- Use Unicode for &Delta; = &#x394; and &VerticalBar; = &#x02223; -->
                <mml:mrow>
                    <mml:mfenced open="&#x02223;" close="&#x02223;">
                        <mml:mrow>
                            <mml:mo>&#x394;</mml:mo>
                            <mml:mi mathvariant="italic">x</mml:mi>
                        </mml:mrow>
                    </mml:mfenced>
                    <mml:mo>&gt;=</mml:mo>
                    <mml:mfenced open="&#x02223;" close="&#x02223;">
                        <mml:mrow>
                            <mml:mo>&#x394;</mml:mo>
                            <mml:mi mathvariant="italic">y</mml:mi>
                        </mml:mrow>
                    </mml:mfenced>
                </mml:mrow>
            </mml:math></inlineequation>,
            <emphasis>i</emphasis> pixels are filled in each column that is rasterized,
            where <emphasis>i</emphasis> is the rounded value of <parameter>width</parameter>.
            Otherwise,
            <emphasis>i</emphasis> pixels are filled in each row that is rasterized.
        </para>
        <para>
            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.
        </para>
        <para>
            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 and the size
            difference between supported widths within the range, call <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
            with arguments <constant>GL_ALIASED_LINE_WIDTH_RANGE</constant>,
            <constant>GL_SMOOTH_LINE_WIDTH_RANGE</constant>, and <constant>GL_SMOOTH_LINE_WIDTH_GRANULARITY</constant>.
        </para>
    </refsect1>
    <refsect1 id="notes"><title>Notes</title>
        <para>
            The line width specified by <function>glLineWidth</function> is always returned when <constant>GL_LINE_WIDTH</constant>
            is queried.
            Clamping and rounding for aliased and antialiased lines have no effect on the specified value.
        </para>
        <para>
            Nonantialiased line width may be clamped to an implementation-dependent maximum.  Call <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with <constant>GL_ALIASED_LINE_WIDTH_RANGE</constant> to determine the maximum width.
        </para>
        <para>
            In OpenGL 1.2, the tokens <constant>GL_LINE_WIDTH_RANGE</constant> and <constant>GL_LINE_WIDTH_GRANULARITY</constant> were replaced by <constant>GL_ALIASED_LINE_WIDTH_RANGE</constant>,
            <constant>GL_SMOOTH_LINE_WIDTH_RANGE</constant>, and <constant>GL_SMOOTH_LINE_WIDTH_GRANULARITY</constant>.  The old names are retained for backward compatibility, but should not be used in new code.
        </para>
    </refsect1>
    <refsect1 id="errors"><title>Errors</title>
        <para>
            <constant>GL_INVALID_VALUE</constant> is generated if <parameter>width</parameter> is less than or equal to 0.
        </para>
    </refsect1>
    <refsect1 id="associatedgets"><title>Associated Gets</title>
        <para>
            <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_LINE_WIDTH</constant>
        </para>
        <para>
            <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_ALIASED_LINE_WIDTH_RANGE</constant>
        </para>
        <para>
            <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_SMOOTH_LINE_WIDTH_RANGE</constant>
        </para>
        <para>
            <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_SMOOTH_LINE_WIDTH_GRANULARITY</constant>
        </para>
        <para>
            <citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_LINE_SMOOTH</constant>
        </para>
    </refsect1>
    <refsect1 id="seealso"><title>See Also</title>
        <para>
            <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry>
        </para>
    </refsect1>
    <refsect1 id="Copyright"><title>Copyright</title>
        <para>
            Copyright <trademark class="copyright"></trademark> 1991-2006 Silicon Graphics, Inc.
            Copyright <trademark class="copyright"></trademark> 2010-2013 Khronos Group.
            This document is licensed under the SGI Free Software B License.
            For details, see
            <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
        </para>
    </refsect1>
</refentry>