Depth, blending & cullingGL 1.0
glPolygonMode
Draws polygons filled, as wireframe lines, or as points.
Signature
void glPolygonMode(GLenum face, GLenum mode);
How it works
A debugging favorite: GL_LINE shows the triangle edges of everything you draw, which makes it easy to see mesh density, broken indices or missing triangles.
Parameters
faceGLenum
Must be GL_FRONT_AND_BACK in the core profile.
modeGLenum
How to rasterize.
Common values
- GL_FILL
- Filled triangles (default).
- GL_LINE
- Wireframe.
- GL_POINT
- Only vertices.
Example
example.cpp
1glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); // wireframe on
2drawScene();
3glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); // back to normal