Setting polygon fill modeΒΆ

SetPolyFill()

Set polygon fill mode


SYNTAX

SetPolyFill(window_id, mode)

Set the polygon fill mode to be used by subsequent functions that fill polygons.

The mode should be one of the following:

PF_ALTERNATE

Alternate mode. This fills the area between odd-numbered and even-numbered polygon sides on each scan line - i.e. fills the area between the first and second side, between the third and fourth side, and so on.

PF_WINDING

Winding mode. Fills any region that has a non-zero winding value. The winding value is the number of times a pen used to draw the polygon would go around the region. The direction of each edge of the polygon is important.

In general, the modes differ only in cases where a complex, overlapping polygon is to be filled - for example, a five-sided polygon that forms a five-sided star with a pentagon at the centre. In polygons such as this, PF_ALTERNATE mode fills every other enclosed region within the polygon - in this case, the points of the star - while PF_WINDING fills all regions (the points of the star and the pentagon).


RELATED TOPICS

Drawing operations

Draw functions

Polygon()