Gl.PolygonMode (gb.opengl)
Static Sub PolygonMode ( Face As Integer, Mode As Integer )
Select a polygon rasterization mode.
Parameters
- face
-
Specifies the polygons that mode applies to.
Must be Gl.FRONT_AND_BACK for front- and back-facing polygons.
- mode
-
Specifies how polygons will be rasterized.
Accepted values are
Gl.POINT,
Gl.LINE, and
Gl.FILL.
The initial value is Gl.FILL for both front- and back-facing polygons.
Description
Gl.PolygonMode controls the interpretation of polygons for rasterization.
face describes which polygons
mode applies to:
both front and back-facing polygons (Gl.FRONT_AND_BACK).
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:
- Gl.POINT
-
Polygon vertices that are marked as the start of a boundary edge
are drawn as points.
Point attributes such as
Gl.POINT_SIZE and
Gl.POINT_SMOOTH control
the rasterization of the points.
Polygon rasterization attributes other than Gl.POLYGON_MODE have no effect.
- Gl.LINE
-
Boundary edges of the polygon are drawn as line segments.
Line attributes such as
Gl.LINE_WIDTH and
Gl.LINE_SMOOTH control
the rasterization of the lines.
Polygon rasterization attributes other than Gl.POLYGON_MODE have no effect.
- Gl.FILL
-
The interior of the polygon is filled.
Polygon attributes such as Gl.POLYGON_SMOOTH control the rasterization of the polygon.
Examples
To draw a surface with outlined polygons,
call
glPolygonMode(Gl.FRONT_AND_BACK, Gl.LINE);
Notes
Vertices are marked as boundary or nonboundary with an edge flag.
Edge flags are generated internally by the GL when it decomposes
triangle stips and fans.
Errors
Gl.INVALID_ENUM is generated if either
face or
mode is not
an accepted value.
Associated Gets
Gl.Get with argument Gl.POLYGON_MODE
See also
See original documentation on OpenGL website