diff --git a/include/osg/GLU b/include/osg/GLU index 646468104..754614a30 100644 --- a/include/osg/GLU +++ b/include/osg/GLU @@ -15,9 +15,11 @@ #define OSG_GLU 1 #ifdef __APPLE__ - #include + #include + #define GLU_TESS_CALLBACK GLvoid (CALLBACK*)(...) #else - #include + #include + #define GLU_TESS_CALLBACK GLvoid (CALLBACK*)() #endif #endif // __osgGLU_h diff --git a/src/osgPlugins/dw/ReaderWriterDW.cpp b/src/osgPlugins/dw/ReaderWriterDW.cpp index d4cb54e61..512985734 100644 --- a/src/osgPlugins/dw/ReaderWriterDW.cpp +++ b/src/osgPlugins/dw/ReaderWriterDW.cpp @@ -754,11 +754,11 @@ void _dwobj::buildDrawable(Group *grp, const osgDB::ReaderWriter::Options *optio GLUtesselator* ts=gluNewTess(); - gluTessCallback(ts, GLU_TESS_BEGIN, (void (CALLBACK *) ())myFaceBegin); - gluTessCallback(ts, GLU_TESS_VERTEX, (GLvoid (CALLBACK *) ())myVertex); - gluTessCallback(ts, GLU_TESS_END, (GLvoid (CALLBACK *) ())myFaceEnd); - gluTessCallback(ts, GLU_TESS_ERROR, (GLvoid (CALLBACK *) ())error); - gluTessCallback(ts, GLU_TESS_COMBINE_DATA, (GLvoid (CALLBACK *) ()) &combineCallback); + gluTessCallback(ts, GLU_TESS_BEGIN, (GLU_TESS_CALLBACK) myFaceBegin); + gluTessCallback(ts, GLU_TESS_VERTEX, (GLU_TESS_CALLBACK) myVertex); + gluTessCallback(ts, GLU_TESS_END, (GLU_TESS_CALLBACK) myFaceEnd); + gluTessCallback(ts, GLU_TESS_ERROR, (GLU_TESS_CALLBACK) error); + gluTessCallback(ts, GLU_TESS_COMBINE_DATA, (GLU_TESS_CALLBACK) combineCallback); // for (int nvf=0; nvf<6; nvf++) { // for each length of face // for Geometry we dont need to collect prim types individually // prd.setmode(nvf , nfnvf); // filter out only this type of tesselated face diff --git a/src/osgPlugins/lwo/Tessellator.cpp b/src/osgPlugins/lwo/Tessellator.cpp index 51c4ac226..3fc006de4 100644 --- a/src/osgPlugins/lwo/Tessellator.cpp +++ b/src/osgPlugins/lwo/Tessellator.cpp @@ -46,10 +46,10 @@ bool Tessellator::tessellate(const Polygon &poly, const osg::Vec3Array *points, GLUtesselator *tess = gluNewTess(); - gluTessCallback(tess, GLU_TESS_BEGIN_DATA, reinterpret_cast(cb_begin_data)); - gluTessCallback(tess, GLU_TESS_VERTEX_DATA, reinterpret_cast(cb_vertex_data)); - gluTessCallback(tess, GLU_TESS_END_DATA, reinterpret_cast(cb_end_data)); - gluTessCallback(tess, GLU_TESS_ERROR_DATA, reinterpret_cast(cb_error_data)); + gluTessCallback(tess, GLU_TESS_BEGIN_DATA, (GLU_TESS_CALLBACK) (cb_begin_data)); + gluTessCallback(tess, GLU_TESS_VERTEX_DATA, (GLU_TESS_CALLBACK) (cb_vertex_data)); + gluTessCallback(tess, GLU_TESS_END_DATA, (GLU_TESS_CALLBACK) (cb_end_data)); + gluTessCallback(tess, GLU_TESS_ERROR_DATA, (GLU_TESS_CALLBACK) (cb_error_data)); gluTessBeginPolygon(tess, this); gluTessBeginContour(tess); diff --git a/src/osgUtil/Tesselator.cpp b/src/osgUtil/Tesselator.cpp index fd706016d..9f809dad7 100644 --- a/src/osgUtil/Tesselator.cpp +++ b/src/osgUtil/Tesselator.cpp @@ -35,17 +35,19 @@ Tesselator::~Tesselator() reset(); } + + void Tesselator::beginTesselation() { reset(); if (!_tobj) _tobj = gluNewTess(); - gluTessCallback(_tobj, GLU_TESS_VERTEX_DATA, (GLvoid (CALLBACK*)()) vertexCallback); - gluTessCallback(_tobj, GLU_TESS_BEGIN_DATA, (GLvoid (CALLBACK*)()) beginCallback); - gluTessCallback(_tobj, GLU_TESS_END_DATA, (GLvoid (CALLBACK*)()) endCallback); - gluTessCallback(_tobj, GLU_TESS_COMBINE_DATA,(GLvoid (CALLBACK*)()) combineCallback); - gluTessCallback(_tobj, GLU_TESS_ERROR_DATA, (GLvoid (CALLBACK*)()) errorCallback); + gluTessCallback(_tobj, GLU_TESS_VERTEX_DATA, (GLU_TESS_CALLBACK) vertexCallback); + gluTessCallback(_tobj, GLU_TESS_BEGIN_DATA, (GLU_TESS_CALLBACK) beginCallback); + gluTessCallback(_tobj, GLU_TESS_END_DATA, (GLU_TESS_CALLBACK) endCallback); + gluTessCallback(_tobj, GLU_TESS_COMBINE_DATA,(GLU_TESS_CALLBACK) combineCallback); + gluTessCallback(_tobj, GLU_TESS_ERROR_DATA, (GLU_TESS_CALLBACK) errorCallback); gluTessBeginPolygon(_tobj,this); }