The routine gSetPolygonMask() selects a list of polygon identifiers to define a polygon mask. The polygons are defined as moves or lines between calls to gStartPolygon() and gEndPolygon() and the polygons are stored as a series of vertices in picture coordinates. The list is also copied into a workspace and can be enquired with the routine gEnqPolygonMaskList().
Additional temporary workspace is required by gSetPolygonMask() to store the list and a copy of the polygons that are used to generate the polygonal mask. If gSetWorkspaceLimit() has not been called or if there is not enough workspace to set up the polygonal mask the appropriate error message is output and masking is switched off.
If n=0, no polygons are selected and masking is also switched off. A call to gSetMask2D() will revert to a rectangular mask.