gluTessBeginPolygon, gluTessEndPolygon

[New - Windows 95, OEM Service Release 2]

The gluTessBeginPolygon and gluTessEndPolygon functions delimit a polygon description.

void gluTessBeginPolygon(

    GLUtesselator * tess,

 

    void * polygon_data

 

   );

 

 

void gluTessEndPolygon(

    GLUtesselator * tess

 

   );

 

 

Parameters

tess

The tessellation object (created with gluNewTessCIEF84).

polygon_data

A pointer to user-defined polygon data.

 

Remarks

The gluTessBeginPolygon and gluTessEndPolygon functions delimit the definition of a nonconvex polygon. Within each gluTessBeginPolygon/gluTessEndPolygon pair, include one or more calls to gluTessBeginContour/gluTessEndContourE5GOS7. Within each contour, there are zero or more calls to gluTessVertex57UT_GN. The vertices specify a closed contour (the last vertex of each contour is automatically linked to the first).

The polygon_data parameter is a pointer to a user-defined data structure. If the appropriate callbacks are specified (see gluTessCallback5E3CP), this pointer is returned to the callback function or functions, making it a convenient way to store per-polygon information.

When you call gluTessEndPolygon, the polygon is tessellated, and the resulting triangles are described through callbacks. For descriptions of the callback functions, see gluTessCallback5E3CP.

Example

The following describes a quadrilateral with a triangular hole:

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, gluTessEndContour, gluTessNormal, gluTessProperty, gluTessVertex