MSDN Library

gluTessBeginPolygon, gluTessEndPolygon

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 gluNewTess).
polygon_data
A pointer to a programmer definedpolygon data structure.

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/gluTessEndContour. Within each contour, there are zero or more calls to gluTessVertex. The vertexes 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 programmer-defined data structure. If the appropriate callbacks are specified (see gluTessCallback), 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 gluTessCallback.

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); 

Requirements

  Windows NT/2000: Requires Windows NT 3.5 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Glu.h.
  Library: Use Glu32.lib.

See Also

gluNewTess, gluTessBeginContour, gluTessCallback, gluTessEndContour, gluTessNormal, gluTessProperty, gluTessVertex


  

Community Additions

Show:
© 2016 Microsoft