summaryrefslogtreecommitdiff
path: root/src/OGL_helper.h
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-08-02 22:37:39 (GMT)
committerMarius Kintel <marius@kintel.net>2011-08-02 22:37:39 (GMT)
commite43315363d4e392d54df77d500cf26ba53a7a599 (patch)
treede2972ed112e6c141a2abc8b352c567597767e7b /src/OGL_helper.h
parente8dac70bcd2d950a36baf522113ac9ce0a50c724 (diff)
Reinstated combine callback. Thanks to Giles for pointing it out
Diffstat (limited to 'src/OGL_helper.h')
-rw-r--r--src/OGL_helper.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/OGL_helper.h b/src/OGL_helper.h
index 2aae31b..2764561 100644
--- a/src/OGL_helper.h
+++ b/src/OGL_helper.h
@@ -243,6 +243,21 @@ namespace OGL {
glVertex3dv(pc);
}
+ inline void CGAL_GLU_TESS_CALLBACK combineCallback(GLdouble coords[3], GLvoid *[4], GLfloat [4], GLvoid **dataOut)
+ { static std::list<GLdouble*> pcache;
+ if (dataOut) {
+ GLdouble *n = new GLdouble[3];
+ n[0] = coords[0];
+ n[1] = coords[1];
+ n[2] = coords[2];
+ pcache.push_back(n);
+ *dataOut = n;
+ } else {
+ for (std::list<GLdouble*>::const_iterator i = pcache.begin(); i != pcache.end(); i++)
+ delete[] *i;
+ pcache.clear();
+ }
+ }
enum { SNC_AXES};
enum { SNC_BOUNDARY, SNC_SKELETON };
@@ -396,6 +411,8 @@ namespace OGL {
GLUtesselator* tess_ = gluNewTess();
gluTessCallback(tess_, GLenum(GLU_TESS_VERTEX_DATA),
(GLvoid (CGAL_GLU_TESS_CALLBACK *)(CGAL_GLU_TESS_DOTS)) &vertexCallback);
+ gluTessCallback(tess_, GLenum(GLU_TESS_COMBINE),
+ (GLvoid (CGAL_GLU_TESS_CALLBACK *)(CGAL_GLU_TESS_DOTS)) &combineCallback);
gluTessCallback(tess_, GLenum(GLU_TESS_BEGIN),
(GLvoid (CGAL_GLU_TESS_CALLBACK *)(CGAL_GLU_TESS_DOTS)) &beginCallback);
gluTessCallback(tess_, GLenum(GLU_TESS_END),
contact: Jan Huwald // Impressum