1GLLINEWIDTH(3G) GLLINEWIDTH(3G)
2
3
4
6 glLineWidth - specify the width of rasterized lines
7
8
10 void glLineWidth( GLfloat width )
11
12
14 width Specifies the width of rasterized lines. The initial value is
15 1.
16
18 glLineWidth specifies the rasterized width of both aliased and
19 antialiased lines. Using a line width other than 1 has different
20 effects, depending on whether line antialiasing is enabled. To enable
21 and disable line antialiasing, call glEnable and glDisable with argu‐
22 ment GL_LINE_SMOOTH. Line antialiasing is initially disabled.
23
24 If line antialiasing is disabled, the actual width is determined by
25 rounding the supplied width to the nearest integer. (If the rounding
26 results in the value 0, it is as if the line width were 1.) If
27 |Δx|≥|Δy|, i pixels are filled in each column that is rasterized, where
28 i is the rounded value of width. Otherwise, i pixels are filled in
29 each row that is rasterized.
30
31 If antialiasing is enabled, line rasterization produces a fragment for
32 each pixel square that intersects the region lying within the rectangle
33 having width equal to the current line width, length equal to the
34 actual length of the line, and centered on the mathematical line seg‐
35 ment. The coverage value for each fragment is the window coordinate
36 area of the intersection of the rectangular region with the correspond‐
37 ing pixel square. This value is saved and used in the final rasteriza‐
38 tion step.
39
40 Not all widths can be supported when line antialiasing is enabled. If
41 an unsupported width is requested, the nearest supported width is used.
42 Only width 1 is guaranteed to be supported; others depend on the imple‐
43 mentation. Likewise, there is a range for aliased line widths as well.
44 To query the range of supported widths and the size difference between
45 supported widths within the range, call glGet with arguments
46 GL_ALIASED_LINE_WIDTH_RANGE, GL_SMOOTH_LINE_WIDTH_RANGE,
47 GL_SMOOTH_LINE_WIDTH_GRANULARITY.
48
50 The line width specified by glLineWidth is always returned when
51 GL_LINE_WIDTH is queried. Clamping and rounding for aliased and
52 antialiased lines have no effect on the specified value.
53
54 Nonantialiased line width may be clamped to an implementation-dependent
55 maximum. Call glGet with GL_ALIASED_LINE_WIDTH_RANGE to determine the
56 maximum width.
57
59 GL_INVALID_VALUE is generated if width is less than or equal to 0.
60
61 GL_INVALID_OPERATION is generated if glLineWidth is executed between
62 the execution of glBegin and the corresponding execution of glEnd.
63
65 glGet with argument GL_LINE_WIDTH
66 glGet with argument GL_ALIASED_LINE_WIDTH_RANGE
67 glGet with argument GL_SMOOTH_LINE_WIDTH_RANGE
68 glGet with argument GL_SMOOTH_LINE_WIDTH_GRANULARITY
69 glIsEnabled with argument GL_LINE_SMOOTH
70
72 glEnable(3G)
73
74
75
76 GLLINEWIDTH(3G)