GLUtessellatorCallback
GLUtessellatorCallback interface provides methods that the user will override to define the callbacks for a tessellation object.
Author
Eric Veach, July 1994
Java Port: Pepijn Van Eeckhoudt, July 2003
Java Port: Nathan Parker Burg, August 2003
Kotlin port: Edwin Jakobs, December 2021
Inheritors
Functions
The begin callback method is invoked like javax.media.opengl.GL.glBegin to indicate the start of a (triangle) primitive. The method takes a single argument of type int. If the GLU_TESS_BOUNDARY_ONLY property is set to GL_FALSE, then the argument is set to either GL_TRIANGLE_FAN, GL_TRIANGLE_STRIP, or GL_TRIANGLES. If the GLU_TESS_BOUNDARY_ONLY property is set to GL_TRUE, then the argument will be set to GL_LINE_LOOP.
The combine callback method is called to create a new vertex when the tessellation detects an intersection, or wishes to merge features. The method takes four arguments: an array of three elements each of type double, an array of four references, an array of four elements each of type float, and a reference to a reference.
The same as the .combine callback method except that it takes an additional reference argument. This reference is identical to the opaque reference provided when GLU.gluTessBeginPolygon was called.
The edgeFlag callback method is similar to javax.media.opengl.GL.glEdgeFlag. The method takes a single boolean boundaryEdge that indicates which edges lie on the polygon boundary. If the boundaryEdge is GL_TRUE, then each vertex that follows begins an edge that lies on the polygon boundary, that is, an edge that separates an interior region from an exterior one. If the boundaryEdge is GL_FALSE, then each vertex that follows begins an edge that lies in the polygon interior. The edge flag callback (if defined) is invoked before the first vertex callback.
The same as the .edgeFlag callback method except that it takes an additional reference argument. This reference is identical to the opaque reference provided when GLU.gluTessBeginPolygon was called.
The error callback method is called when an error is encountered. The one argument is of type int; it indicates the specific error that occurred and will be set to one of GLU_TESS_MISSING_BEGIN_POLYGON, GLU_TESS_MISSING_END_POLYGON, GLU_TESS_MISSING_BEGIN_CONTOUR, GLU_TESS_MISSING_END_CONTOUR, GLU_TESS_COORD_TOO_LARGE, GLU_TESS_NEED_COMBINE_CALLBACK or GLU_OUT_OF_MEMORY. Character strings describing these errors can be retrieved with the gluErrorString call.
The vertex callback method is invoked between the .begin and .end callback methods. It is similar to javax.media.opengl.GL.glVertex3f, and it defines the vertices of the triangles created by the tessellation process. The method takes a reference as its only argument. This reference is identical to the opaque reference provided by the user when the vertex was described (see GLU.gluTessVertex).
The same as the .vertex callback method except that it takes an additional reference argument. This reference is identical to the opaque reference provided when GLU.gluTessBeginPolygon was called.