From e3cb0aa36f8640fa21fac697c11c7be71701c16a Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 12 Apr 2013 10:37:06 +0200 Subject: [PATCH] Tesselation error fix. Added missing callback function (combine callback). --- common/gal/opengl/opengl_gal.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 0005035212..301fc26021 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -1394,6 +1394,18 @@ void CALLBACK VertexCallback( GLvoid* aVertexPtr ) } +void CALLBACK CombineCallback( GLdouble coords[3], + GLdouble* vertex_data[4], + GLfloat weight[4], GLdouble** dataOut ) +{ + GLdouble* vertex = new GLdouble[3]; + + memcpy( vertex, coords, 3 * sizeof(GLdouble) ); + + *dataOut = vertex; +} + + void CALLBACK BeginCallback( GLenum aWhich ) { glBegin( aWhich ); @@ -1417,10 +1429,11 @@ void CALLBACK ErrorCallback( GLenum aErrorCode ) void InitTesselatorCallbacks( GLUtesselator* aTesselator ) { - gluTessCallback( aTesselator, GLU_TESS_VERTEX, ( void (CALLBACK*)() )VertexCallback ); - gluTessCallback( aTesselator, GLU_TESS_BEGIN, ( void (CALLBACK*)() )BeginCallback ); - gluTessCallback( aTesselator, GLU_TESS_END, ( void (CALLBACK*)() )EndCallback ); - gluTessCallback( aTesselator, GLU_TESS_ERROR, ( void (CALLBACK*)() )ErrorCallback ); + gluTessCallback( aTesselator, GLU_TESS_VERTEX, ( void (CALLBACK*)() )VertexCallback ); + gluTessCallback( aTesselator, GLU_TESS_COMBINE, ( void (CALLBACK*)() )CombineCallback ); + gluTessCallback( aTesselator, GLU_TESS_BEGIN, ( void (CALLBACK*)() )BeginCallback ); + gluTessCallback( aTesselator, GLU_TESS_END, ( void (CALLBACK*)() )EndCallback ); + gluTessCallback( aTesselator, GLU_TESS_ERROR, ( void (CALLBACK*)() )ErrorCallback ); }