Contents / Previous / Next


Stippled Polygons

By default, filled polygons are drawn with a solid pattern. They can also be filled with a 32-bit by 32-bit window-aligned stipple pattern, which you specify with:

void glPolygonStipple( const GLubyte *mask, int mask_offset )

mask is a pointer to a 32 by 32 bitmap that is interpreted as a mask of 0s and 1s.

[IMAGE]
 

The results of polygons drawn unstippled and then with two different stippling patterns:

[IMAGE]
 

In addition to defining the current polygon stippling pattern, you must enable stippling:

glEnable(GL_POLYGON_STIPPLE);
Use glDisable() with the same argument to disable polygon stippling.

Polygon stippling is enabled and disabled by using:

glEnable( GL_POLYGON_STIPPLE ) and
glDisable( GL_POLYGON_STIPPLE )

The interpretation of the mask data is affected by the glPixelStore*() GL_UNPACK* modes.