Fix for Tiger build

This commit is contained in:
Robert Osfield 2005-05-04 11:38:34 +00:00
parent a1f23bbccd
commit f8c855a576
4 changed files with 20 additions and 16 deletions

View File

@ -16,8 +16,10 @@
#ifdef __APPLE__
#include <OpenGL/glu.h>
#define GLU_TESS_CALLBACK GLvoid (CALLBACK*)(...)
#else
#include <GL/glu.h>
#define GLU_TESS_CALLBACK GLvoid (CALLBACK*)()
#endif
#endif // __osgGLU_h

View File

@ -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

View File

@ -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<void (CALLBACK *)()>(cb_begin_data));
gluTessCallback(tess, GLU_TESS_VERTEX_DATA, reinterpret_cast<void (CALLBACK *)()>(cb_vertex_data));
gluTessCallback(tess, GLU_TESS_END_DATA, reinterpret_cast<void (CALLBACK *)()>(cb_end_data));
gluTessCallback(tess, GLU_TESS_ERROR_DATA, reinterpret_cast<void (CALLBACK *)()>(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);

View File

@ -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);
}