Introduced optional build against the GLU library, using optional compile paths to enable/disable GLU related function.

To toggle the use of the GLU library adjust the OSG_GLU_AVAILABLE variable via ccmake . or CMakeSetup.
This commit is contained in:
Robert Osfield
2009-10-07 19:42:32 +00:00
parent 6992e8eedf
commit 2d26cbe7ab
15 changed files with 299 additions and 179 deletions

View File

@@ -14,19 +14,25 @@
#ifndef OSG_GLU
#define OSG_GLU 1
#include <osg/GL>
#include <osg/Config>
#if defined(__APPLE__) || \
(defined (_AIX) && !defined (_AIX51))
#include <OpenGL/glu.h>
#else
#include <GL/glu.h>
#endif
#ifdef OSG_GLU_AVAILABLE
#include <osg/GL>
#if defined(__APPLE__) || \
(defined (_AIX) && !defined (_AIX51))
#include <OpenGL/glu.h>
#else
#include <GL/glu.h>
#endif
#if defined(GLU_TESS_CALLBACK_TRIPLEDOT)
typedef void (APIENTRY *GLU_TESS_CALLBACK)(...);
#else
typedef void (APIENTRY *GLU_TESS_CALLBACK)();
#endif
#if defined(GLU_TESS_CALLBACK_TRIPLEDOT)
typedef void (APIENTRY *GLU_TESS_CALLBACK)(...);
#else
typedef void (APIENTRY *GLU_TESS_CALLBACK)();
#endif
#endif // __osgGLU_h

View File

@@ -23,6 +23,19 @@
namespace osgUtil {
#ifndef OSG_GLU_AVAILABLE
// as we have no GLU we'll just define the required enum values
#define GLU_FALSE 0
#define GLU_FILL 100012
#define GLU_SMOOTH 100000
#define GLU_OUTSIDE 100020
#define GLU_NONE 100002
#define GLU_POINT 100010
#define GLU_LINE 100011
#define GLU_FILL 100012
#define GLU_SILHOUETTE 100013
#endif
/** A class for assisting the building ascene graphs that is equivilant to OpenGL 1.0 style calls.
*/
class OSGUTIL_EXPORT SceneGraphBuilder

View File

@@ -42,6 +42,7 @@ class OSGUTIL_EXPORT Tessellator : public osg::Referenced
~Tessellator();
/** The winding rule, see red book ch 11. */
#ifdef OSG_GLU_AVAILABLE
enum WindingType{
TESS_WINDING_ODD = GLU_TESS_WINDING_ODD,
TESS_WINDING_NONZERO = GLU_TESS_WINDING_NONZERO ,
@@ -49,7 +50,15 @@ class OSGUTIL_EXPORT Tessellator : public osg::Referenced
TESS_WINDING_NEGATIVE = GLU_TESS_WINDING_NEGATIVE ,
TESS_WINDING_ABS_GEQ_TWO = GLU_TESS_WINDING_ABS_GEQ_TWO
} ;
#else
enum WindingType{
TESS_WINDING_ODD,
TESS_WINDING_NONZERO,
TESS_WINDING_POSITIVE,
TESS_WINDING_NEGATIVE,
TESS_WINDING_ABS_GEQ_TWO
} ;
#endif
/** we interpret all contours in the geometry as a single set to be tessellated or
* each separate drawable's contours needs to be tessellated. */
enum TessellationType {
@@ -211,7 +220,11 @@ class OSGUTIL_EXPORT Tessellator : public osg::Referenced
typedef std::vector<NewVertex> NewVertexList;
typedef std::vector<Vec3d*> Vec3dList;
#ifdef OSG_GLU_AVAILABLE
GLUtesselator* _tobj;
#else
void* _tobj;
#endif
PrimList _primList;
Vec3dList _coordData;
NewVertexList _newVertexList;