1991-2006 Silicon Graphics, Inc.
gluTessBeginPolygon 3G
gluTessBeginPolygon delimit a polygon description

## C Specification

void `gluTessBeginPolygon` GLUtesselator* tess GLvoid* data

## Parameters

tess

  Specifies the tessellation object (created with gluNewTess).

data

  Specifies a pointer to user polygon data.

## Description

`gluTessBeginPolygon` and gluTessEndPolygon delimit the definition of a convex, concave or self-intersecting polygon. Within each `gluTessBeginPolygon`/gluTessEndPolygon pair, there must be one or more calls to gluTessBeginContour/gluTessEndContour. Within each contour, there are zero or more calls to gluTessVertex. The vertices specify a closed contour (the last vertex of each contour is automatically linked to the first). See the gluTessVertex, gluTessBeginContour, and gluTessEndContour reference pages for more details.

data is a pointer to a user-defined data structure. If the appropriate callback(s) are specified (see gluTessCallback), then this pointer is returned to the callback function(s). Thus, it is a convenient way to store per-polygon information.

Once gluTessEndPolygon is called, the polygon is tessellated, and the resulting triangles are described through callbacks. See gluTessCallback for descriptions of the callback functions.

## Example

A quadrilateral with a triangular hole in it can be described as follows:

    gluTessBeginPolygon(tobj, NULL);
       gluTessBeginContour(tobj);
          gluTessVertex(tobj, v1, v1);
          gluTessVertex(tobj, v2, v2);
          gluTessVertex(tobj, v3, v3);
          gluTessVertex(tobj, v4, v4);
       gluTessEndContour(tobj);
       gluTessBeginContour(tobj);
          gluTessVertex(tobj, v5, v5);
          gluTessVertex(tobj, v6, v6);
          gluTessVertex(tobj, v7, v7);
       gluTessEndContour(tobj);
    gluTessEndPolygon(tobj);

## See Also

gluNewTess, gluTessBeginContour, gluTessCallback, gluTessEndPolygon, gluTessNormal, gluTessProperty, gluTessVertex

## Copyright

Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.