// gcc -std=c99 -Wall -o tessellation-test tessellation-test.c -lGLU -lGL #include #include #include void GLAPIENTRY vertex(void *v){ printf("vertex %p\n", v); } int main() { GLdouble coords[3][3] = {{0, 0, 0}, {1, 0, 0}, {1, 1, 0}}; int whatevs = 0; for(int j = 0; j < 2; j++){ GLUtesselator* tess = gluNewTess(); assert(tess); gluTessCallback(tess, GLU_TESS_VERTEX, (void(*)())&vertex); gluTessBeginPolygon(tess, NULL); gluTessBeginContour(tess); for(int i = 0; i < sizeof(coords) / ((sizeof(GLdouble) * 3)); i++) gluTessVertex(tess, coords[i], j == 0 ? &whatevs : NULL); gluTessEndContour(tess); gluTessEndPolygon(tess); gluDeleteTess(tess); } return 0; }