glPolygonMode(3G) OpenGL Reference glPolygonMode(3G)
NAME
glPolygonMode - select a polygon rasterization mode
C SPECIFICATION
void glPolygonMode( GLenum face,
GLenum mode )
PARAMETERS
face Specifies the polygons that mode applies to. Must be GLFRONT for
front-facing polygons, GLBACK for back-facing polygons, or
GLFRONTANDBACK for front- and back-facing polygons.
mode Specifies how polygons will be rasterized. Accepted values are
GLPOINT, GLLINE, and GLFILL. The initial value is GLFILL for
both front- and back-facing polygons.
DESCRIPTION
glPolygonMode controls the interpretation of polygons for rasterization.
face describes which polygons mode applies to: front-facing polygons
(GLFRONT), back-facing polygons (GLBACK), or both (GLFRONTANDBACK).
The polygon mode affects only the final rasterization of polygons. In
particular, a polygon's vertices are lit and the polygon is clipped and
possibly culled before these modes are applied.
Three modes are defined and can be specified in mode:
GLPOINT Polygon vertices that are marked as the start of a boundary
edge are drawn as points. Point attributes such as
GLPOINTSIZE and GLPOINTSMOOTH control the rasterization
of the points. Polygon rasterization attributes other than
GLPOLYGONMODE have no effect.
GLLINE Boundary edges of the polygon are drawn as line segments.
They are treated as connected line segments for line
stippling; the line stipple counter and pattern are not
reset between segments (see glLineStipple). Line
attributes such as GLLINEWIDTH and GLLINESMOOTH control
the rasterization of the lines. Polygon rasterization
attributes other than GLPOLYGONMODE have no effect.
GLFILL The interior of the polygon is filled. Polygon attributes
such as GLPOLYGONSTIPPLE and GLPOLYGONSMOOTH control
the rasterization of the polygon.
EXAMPLES
To draw a surface with filled back-facing polygons and outlined front-
facing polygons, call
glPolygonMode(GLFRONT, GLLINE);
Page 1
glPolygonMode(3G) OpenGL Reference glPolygonMode(3G)
NOTES
Vertices are marked as boundary or nonboundary with an edge flag. Edge
flags are generated internally by the GL when it decomposes polygons;
they can be set explicitly using glEdgeFlag.
ERRORS
GLINVALIDENUM is generated if either face or mode is not an accepted
value.
GLINVALIDOPERATION is generated if glPolygonMode is executed between
the execution of glBegin and the corresponding execution of glEnd.
ASSOCIATED GETS
glGet with argument GLPOLYGONMODE
SEE ALSO
glBegin, glEdgeFlag, glLineStipple, glLineWidth, glPointSize,
glPolygonStipple
Page 2