xenocara/doc/gl-docs/GL/gl/linewidth.3gl
2006-11-29 17:00:35 +00:00

97 lines
3.3 KiB
Plaintext

'\" e
'\"! eqn | mmdoc
'\"macro stdmacro
.ds Vn Version 1.2
.ds Dt 24 September 1999
.ds Re Release 1.2.1
.ds Dp Jan 14 18:30
.ds Dm 01 linewidth
.ds Xs 48623 5 linewidth.gl
.TH GLLINEWIDTH 3G
.SH NAME
.B "glLineWidth
\- specify the width of rasterized lines
.SH C SPECIFICATION
void \f3glLineWidth\fP(
GLfloat \fIwidth\fP )
.nf
.fi
.EQ
delim $$
.EN
.SH PARAMETERS
.TP \w'\f2width\fP\ \ 'u
\f2width\fP
Specifies the width of rasterized lines.
The initial value is 1.
.SH DESCRIPTION
\%\f3glLineWidth\fP 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
\%\f3glEnable\fP and \%\f3glDisable\fP
with argument \%\f3GL_LINE_SMOOTH\fP. Line antialiasing is initially
disabled.
.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
$| DELTA x | ~>=~ | DELTA y |$,
\f2i\fP pixels are filled in each column that is rasterized,
where \f2i\fP is the rounded value of \f2width\fP.
Otherwise,
\f2i\fP pixels are filled in each row that is rasterized.
.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
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 \%\f3glGet\fP
with arguments \%\f3GL_ALIASED_LINE_WIDTH_RANGE\fP,
\%\f3GL_SMOOTH_LINE_WIDTH_RANGE\fP, \%\f3GL_SMOOTH_LINE_WIDTH_GRANULARITY\fP.
.SH NOTES
The line width specified by \%\f3glLineWidth\fP is always returned when \%\f3GL_LINE_WIDTH\fP
is queried.
Clamping and rounding for aliased and antialiased lines have no effect
on the specified value.
.P
Nonantialiased line width may be clamped to an implementation-dependent
maximum. Call \%\f3glGet\fP with \%\f3GL_ALIASED_LINE_WIDTH_RANGE\fP to
determine the maximum width.
.SH ERRORS
\%\f3GL_INVALID_VALUE\fP is generated if \f2width\fP is less than or equal to 0.
.P
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glLineWidth\fP
is executed between the execution of \%\f3glBegin\fP
and the corresponding execution of \%\f3glEnd\fP.
.SH ASSOCIATED GETS
\%\f3glGet\fP with argument \%\f3GL_LINE_WIDTH\fP
.br
\%\f3glGet\fP with argument \%\f3GL_ALIASED_LINE_WIDTH_RANGE\fP
.br
\%\f3glGet\fP with argument \%\f3GL_SMOOTH_LINE_WIDTH_RANGE\fP
.br
\%\f3glGet\fP with argument \%\f3GL_SMOOTH_LINE_WIDTH_GRANULARITY\fP
.br
\%\f3glIsEnabled\fP with argument \%\f3GL_LINE_SMOOTH\fP
.SH SEE ALSO
\%\f3glEnable(3G)\fP