#ifndef TESSELATOR_H
#define TESSELATOR_H
#ifdef __cplusplus
extern "C" {
#endif
enum TessWindingRule
{
TESS_WINDING_ODD,
TESS_WINDING_NONZERO,
TESS_WINDING_POSITIVE,
TESS_WINDING_NEGATIVE,
TESS_WINDING_ABS_GEQ_TWO,
};
enum TessElementType
{
TESS_POLYGONS,
TESS_CONNECTED_POLYGONS,
TESS_BOUNDARY_CONTOURS,
};
enum TessOption
{
TESS_CONSTRAINED_DELAUNAY_TRIANGULATION,
TESS_REVERSE_CONTOURS
};
typedef float TESSreal;
typedef int TESSindex;
typedef struct TESStesselator TESStesselator;
typedef struct TESSalloc TESSalloc;
#define TESS_UNDEF (~(TESSindex)0)
#define TESS_NOTUSED(v) do { (void)(1 ? (void)0 : ( (void)(v) ) ); } while(0)
struct TESSalloc
{
void *(*memalloc)( void *userData, unsigned int size );
void *(*memrealloc)( void *userData, void* ptr, unsigned int size );
void (*memfree)( void *userData, void *ptr );
void* userData; int meshEdgeBucketSize; int meshVertexBucketSize; int meshFaceBucketSize; int dictNodeBucketSize; int regionBucketSize; int extraVertices; };
TESStesselator* tessNewTess( TESSalloc* alloc );
void tessDeleteTess( TESStesselator *tess );
void tessAddContour( TESStesselator *tess, int size, const void* pointer, int stride, int count );
void tessSetOption( TESStesselator *tess, int option, int value );
int tessTesselate( TESStesselator *tess, int windingRule, int elementType, int polySize, int vertexSize, const TESSreal* normal );
int tessGetVertexCount( TESStesselator *tess );
const TESSreal* tessGetVertices( TESStesselator *tess );
const TESSindex* tessGetVertexIndices( TESStesselator *tess );
int tessGetElementCount( TESStesselator *tess );
const TESSindex* tessGetElements( TESStesselator *tess );
#ifdef __cplusplus
};
#endif
#endif