Tesselation error fix.

Added missing callback function (combine callback).
This commit is contained in:
Maciej Suminski 2013-04-12 10:37:06 +02:00
parent b1144a864f
commit e3cb0aa36f
1 changed files with 17 additions and 4 deletions

View File

@ -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 );
@ -1418,6 +1430,7 @@ void CALLBACK ErrorCallback( GLenum aErrorCode )
void InitTesselatorCallbacks( GLUtesselator* aTesselator )
{
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 );