First batch of changes required for MacOS X build. Orignal submission from

Phil Atkin, merged by Robert Osfield.
This commit is contained in:
Robert Osfield
2002-01-16 10:36:20 +00:00
parent f7e944c47f
commit 1fb8f9cb86
33 changed files with 116 additions and 26 deletions

View File

@@ -1,14 +1,14 @@
all : $(MAKEDEPEND) $(TARGET) $(LIB) $(DYLIB)
all : $(MAKEDEPEND) $(TARGET) $(LOADABLE) $(LIB)
$(TARGET) : $(OBJS) $(PLUGINLIBS) $(MACOSXLIBS)
$(C++) $(LDFLAGS) $(MACOSXLIBS) $(OBJS) $(PLUGINS) -o $@
$(TARGET) : $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) $(FRAMEWORKS) $(MACOSXLIBS) -o $@
$(LIB) : $(OBJS)
$(LIBTOOL) -static -o $@ $(OBJS)
$(CC) -dynamiclib -o $@ $(OBJS) $(MACOSXLIBS) $(FRAMEWORKS)
$(DYLIB) : $(OBJS)
$(LIBTOOL) -static -o $@ $(OBJS)
$(LOADABLE) : $(OBJS)
$(CC) -bundle -o $@ $(OBJS) $(MACOSXLIBS) $(FRAMEWORKS)
clean :
rm -f $(OBJS) core $(TARGET) $(MAKEDEPEND)

View File

@@ -9,7 +9,7 @@
// non windows, doesn't require nonsense as seen below :-)
#ifndef __gl_h_
#ifdef __APPLE_CC__
#ifdef __DARWIN_OSX__
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>

View File

@@ -5,7 +5,7 @@
#ifndef OSG_GLU
#define OSG_GLU 1
#ifdef __APPLE_CC__
#ifdef __DARWIN_OSX__
#include <OpenGL/glu.h>
#else
#include <GL/glu.h>

View File

@@ -33,7 +33,7 @@ class SG_EXPORT Timer {
Timer();
~Timer() {}
#if defined __APPLE__ || defined macintosh
#if defined __DARWIN_OSX__ || defined macintosh
// PJA MAC OSX - inline Tick() pollutes namespace so badly
// we cant compile, due to Carbon.h ...
Timer_t tick();
@@ -150,7 +150,7 @@ namespace osg{
}
};
#elif !defined (__APPLE_CC__) && !defined (macintosh)
#elif !defined (__DARWIN_OSX__) && !defined (macintosh)
// no choice, always use std::clock()

View File

@@ -56,6 +56,7 @@ public:
virtual int getAscender() const;
int getPointSize(void) const { return _pointSize; }
int getTextureSize(void) const { return _textureSize; }
const std::string& getFontName();
FTFont* getFont(void) { return _font; }
@@ -77,6 +78,7 @@ protected:
std::string _fontName;
int _pointSize;
int _res;
int _textureSize;
};
// Font
///////////////////////////////////////////////////////////////////////////////
@@ -167,6 +169,10 @@ public:
TextureFont(const std::string& font,
int point_size);
TextureFont(const std::string& font,
int point_size,
int textureSize );
META_Object(TextureFont);

View File

@@ -21,6 +21,11 @@ TARGET_BIN_FILES = hangglide
#note, standard library list.
LIBS = -losgGLUT -losgUtil -losgDB -losg $(GLUTLIB) $(GL_LIBS) $(X_LIBS)
#under Darwin we have to use the framework stuff to get GLUT OpenGL etc.
MACOSXLIBS = -losgGLUT -losgUtil -losgDB -losg -lm -ldl -lstdc++ -lobjc
# $(OSGDB_LIBS)
C++FLAGS += -I. -I$(OSGHOME)/include
LDFLAGS += -L$(OSGHOME)/lib

View File

@@ -16,6 +16,9 @@ TARGET_BIN_FILES = osgconv
#note, standard library list.
LIBS = -losgDB -losg $(GL_LIBS) $(X_LIBS)
#under Darwin we have to use the framework stuff to get GLUT OpenGL etc.
MACOSXLIBS = -losgGLUT -losgUtil -losgDB -losg -lm -ldl -lstdc++ -lobjc
C++FLAGS += -I$(OSGHOME)/include
LDFLAGS += -L$(OSGHOME)/lib

View File

@@ -9,6 +9,10 @@ TARGET = $(OSGHOME)/bin/osgcube
TARGET_BIN_FILES = osgcube
LIBS = -losgGLUT -losgDB -losgUtil -losg $(GLUTLIB) $(GL_LIBS) $(X_LIBS)
#under Darwin we have to use the framework stuff to get GLUT OpenGL etc.
MACOSXLIBS = -losgGLUT -losgUtil -losgDB -losg -lm -ldl -lstdc++ -lobjc
C++FLAGS += -I$(OSGHOME)/include
LDFLAGS += -L$(OSGHOME)/lib

View File

@@ -14,6 +14,9 @@ TARGET_BIN_FILES = osgimpostor
#note, standard library list.
LIBS = -losgGLUT -losgUtil -losgDB -losg $(GLUTLIB) $(GL_LIBS) $(X_LIBS)
#under Darwin we have to use the framework stuff to get GLUT OpenGL etc.
MACOSXLIBS = -losgGLUT -losgUtil -losgDB -losg -lm -ldl -lstdc++ -lobjc
C++FLAGS += -I$(OSGHOME)/include
LDFLAGS += -L$(OSGHOME)/lib

View File

@@ -9,7 +9,7 @@
#include <osgUtil/DriveManipulator>
#include <osgUtil/InsertImpostorsVisitor>
#include <GL/glut.h>
#include <osgGLUT/glut>
#include <osgGLUT/Viewer>
#include <osg/Quat>

View File

@@ -14,6 +14,10 @@ TARGET_BIN_FILES = osgreflect
#note, standard library list.
LIBS = -losgGLUT -losgUtil -losgDB -losg $(GLUTLIB) $(GL_LIBS) $(X_LIBS)
#under Darwin we have to use the framework stuff to get GLUT OpenGL etc.
MACOSXLIBS = -losgGLUT -losgUtil -losgDB -losg -lm -ldl -lstdc++ -lobjc
C++FLAGS += -I$(OSGHOME)/include
LDFLAGS += -L$(OSGHOME)/lib

View File

@@ -13,8 +13,9 @@ TARGET_BIN_FILES = osgtext
#note, standard library list.
LIBS = -losgGLUT -losgText -losgUtil -losgDB -losg $(GLUTLIB) $(GL_LIBS) $(X_LIBS)
MACOSXLIBS = -losgGLUT -losgText -losgUtil -losgDB -losg -lfreetype -ldl -lobjc -lstdc++
C++FLAGS += -I$(OSGHOME)/include -g
C++FLAGS += -I$(OSGHOME)/include -I.
LDFLAGS += -L$(OSGHOME)/lib -L/usr/freeware/lib32
include $(OSGHOME)/Make/makerules

View File

@@ -25,7 +25,7 @@
#include <osgUtil/DriveManipulator>
#include <osgGLUT/Viewer>
#include <GL/glut.h>
#include <osgGLUT/glut>
#include <osgText/Text>
#include <vector>
@@ -45,8 +45,8 @@ using namespace osgGLUT;
#define TEXT_COL_3D osg::Vec4(.99,.3,.2,1)
std::string ttfPath("fonts/dirtydoz.ttf");
std::string ttfPath1("fonts/fudd.ttf");
std::string ttfPath("fonts/times.ttf");
std::string ttfPath1("fonts/arial.ttf");
int gFontSize=18;
int gFontSize1=24;

View File

@@ -14,6 +14,10 @@ TARGET_BIN_FILES = osgtexture
#note, standard library list.
LIBS = -losgGLUT -losgUtil -losgDB -losg $(GLUTLIB) $(GL_LIBS) $(X_LIBS)
#under Darwin we have to use the framework stuff to get GLUT OpenGL etc.
MACOSXLIBS = -losgGLUT -losgUtil -losgDB -losg -lm -ldl -lstdc++ -lobjc
C++FLAGS += -I$(OSGHOME)/include
LDFLAGS += -L$(OSGHOME)/lib

View File

@@ -14,6 +14,9 @@ TARGET_BIN_FILES = osgviews
#note, standard library list.
LIBS = -losgGLUT -losgUtil -losgDB -losg $(GLUTLIB) $(GL_LIBS) $(X_LIBS)
#under Darwin we have to use the framework stuff to get GLUT OpenGL etc.
MACOSXLIBS = -losgGLUT -losgUtil -losgDB -losg -lm -ldl -lstdc++ -lobjc
C++FLAGS += -I$(OSGHOME)/include
LDFLAGS += -L$(OSGHOME)/lib

View File

@@ -11,6 +11,10 @@ TARGET_BIN_FILES = sgv
#note, standard library list.
LIBS = -losgGLUT -losgUtil -losgDB -losg $(GLUTLIB) $(GL_LIBS) $(X_LIBS)
#under Darwin we have to use the framework stuff to get GLUT OpenGL etc.
MACOSXLIBS = -losgGLUT -losgUtil -losgDB -losg -lm -ldl -lstdc++ -lobjc
C++FLAGS += -I$(OSGHOME)/include
LDFLAGS += -L$(OSGHOME)/lib

View File

@@ -135,6 +135,7 @@ TARGET_INCLUDE_FILES = \
LIBS = $(GL_LIBS)
MACOSXLIBS = -lm -ldl -lstdc++
LIB = $(OSGHOME)/lib/lib$(TARGET_BASENAME).$(SO_EXT)
#LIB = $(OSGHOME)/lib/lib$(TARGET_BASENAME).a

View File

@@ -197,9 +197,9 @@ using namespace osg;
}
}
#elif defined (__APPLE_CC__) || defined (macintosh)
#elif defined (__DARWIN_OSX__) || defined (macintosh)
#if defined (__APPLE_CC__)
#if defined (__DARWIN_OSX__)
#include <Carbon/Carbon.h> // do I really have to link against the Carbon framework just for this?
#else
#include <MacTypes.h>

View File

@@ -41,6 +41,7 @@ TARGET_INCLUDE_FILES = \
#LIBS = -L$(OSGHOME)/lib -losg -lGLU -lGL -lm -ldl
LIBS = -L$(OSGHOME)/lib -losg $(GL_LIBS) $(DYNAMICLIBRARYLIB)
MACOSXLIBS = -L$(OSGHOME)/lib -losg -ldl -lm -lstdc++ $(DYNAMICLIBRARYLIB)
LIB = $(OSGHOME)/lib/lib$(TARGET_BASENAME).$(SO_EXT)
#LIB = $(OSGHOME)/lib/lib$(TARGET_BASENAME).a

View File

@@ -11,6 +11,8 @@ TARGET_BASENAME = osgGLUT
LIBS = -L$(OSGHOME)/lib -losgDB -losgUtil -losg $(GLUTLIB) $(GL_LIBS)
MACOSXLIBS = -L../../lib -losgDB -losgUtil -losg -ldl -lm -lstdc++
LIB = $(OSGHOME)/lib/lib$(TARGET_BASENAME).$(SO_EXT)
#LIB = $(OSGHOME)/lib/lib$(TARGET_BASENAME).a

View File

@@ -6,6 +6,9 @@ DIRS = osg rgb lib3ds flt obj lwo dw bmp pic tga osgtgz tgz zip
# comment in if you have Performer installed.
# DIRS += pfb
# comment in if you have Performer installed.
# DIRS += quicktime
# comment in if you have libpng installed.
DIRS += png

View File

@@ -26,7 +26,7 @@
#include <osgDB/Registry>
#include <osgDB/ReadFile>
#include <GL/glu.h>
#include <osg/GLU>
using namespace osg;

View File

@@ -1,7 +1,7 @@
// Input.cpp
#include <string>
#include <malloc.h>
// #include <malloc.h>
#include <osg/Notify>
#include <osgDB/FileUtils>

View File

@@ -2,7 +2,7 @@
#include <algorithm>
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <osg/Notify>

View File

@@ -12,7 +12,12 @@
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <osg/Math>
#ifdef __DARWIN_OSX__
#include <stdlib.h>
#else
#include <malloc.h>
#endif
#include "glm.h"

View File

@@ -15,7 +15,7 @@
// non windows, doesn't require nonesense as seen below :-)
#ifndef __gl_h_
#ifdef __APPLE_CC__
#ifdef __DARWIN_OSX__
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else

View File

@@ -27,6 +27,16 @@ FTGLTextureFont::FTGLTextureFont()
padding(1)
{}
FTGLTextureFont::FTGLTextureFont(int textureSize)
: maxTextSize(textureSize),
textureWidth(0),
textureHeight(0),
numTextures(1),
textMem(0),
glyphHeight(0),
glyphWidth(0),
padding(1)
{}
FTGLTextureFont::~FTGLTextureFont()
{

View File

@@ -19,6 +19,7 @@ class FTGL_EXPORT FTGLTextureFont : public FTFont
* Default Constructor
*/
FTGLTextureFont();
FTGLTextureFont(int textureSize);
/**
* Destructor

View File

@@ -31,7 +31,7 @@ using namespace osgText;
// define the default paths to look for fonts.
// note delimator is : for unix, ; for windows.
#if defined(__linux) || defined(__FreeBSD__) || defined (__sgi)
#if defined(__linux) || defined(__FreeBSD__) || defined (__sgi) || defined (__DARWIN_OSX__)
static char* s_FontFilePath = ".:/usr/share/fonts/ttf:/usr/share/fonts/ttf/western:/usr/share/fonts/ttf/decoratives";
#elif defined(WIN32)
static char* s_FontFilePath = ".;C:/windows/fonts";
@@ -67,6 +67,7 @@ Font()
_created=false;
_pointSize=14;
_textureSize=0;
_res=72;
}
@@ -246,13 +247,28 @@ createFontObj(void)
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// PixmapFont
// TextureFont
TextureFont::
TextureFont(const std::string& font,
int point_size):
RasterFont(font)
{
_textureSize=0;
if(init(font))
{
}
_pointSize=point_size;
}
TextureFont::
TextureFont(const std::string& font,
int point_size,
int textureSize ):
RasterFont(font)
{
_textureSize=textureSize;
if(init(font))
{
}
@@ -260,13 +276,14 @@ RasterFont(font)
}
FTFont* TextureFont::
createFontObj(void)
{
return (FTFont*)(new FTGLTextureFont);
return (FTFont*)(new FTGLTextureFont(_textureSize));
}
// PixmapFont
// TextureFont
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

View File

@@ -30,6 +30,7 @@ TARGET_BASENAME = osgText
LIBS = -L$(OSGHOME)/lib -lfreetype -losgDB -losg $(GL_LIBS)
MACOSXLIBS = -L$(OSGHOME)/lib -lfreetype -losgDB -losg -lstdc++
LIB = $(OSGHOME)/lib/lib$(TARGET_BASENAME).$(SO_EXT)
#LIB = $(OSGHOME)/lib/lib$(TARGET_BASENAME).a

View File

@@ -6,8 +6,13 @@
using namespace osg;
using namespace osgUtil;
#ifndef __DARWIN_OSX__
// this is a hack to test OS X ....
// register a RenderStage prototype with the RenderBin prototype list.
RegisterRenderBinProxy<DepthSortedBin> s_registerDepthSortedBinProxy;
#endif
DepthSortedBin::DepthSortedBin()
{

View File

@@ -36,6 +36,7 @@ TARGET_BASENAME = osgUtil
LIBS = -L$(OSGHOME)/lib -losg $(GL_LIBS)
MACOSXLIBS = -L$(OSGHOME)/lib -losg -ldl -lm -lstdc++
LIB = $(OSGHOME)/lib/lib$(TARGET_BASENAME).$(SO_EXT)
#LIB = $(OSGHOME)/lib/lib$(TARGET_BASENAME).a

View File

@@ -6,10 +6,16 @@
using namespace osg;
using namespace osgUtil;
// register a RenderStage prototype with the RenderBin prototype list.
RegisterRenderBinProxy<RenderBin> s_registerRenderBinProxy;
#ifdef __DARWIN_OSX__
// PJA 10/1/02 - this is a hack to get OS X to build, if this code is included in DepthSortedBin.cpp it isnt executed
// register a RenderStage prototype with the RenderBin prototype list.
#include <osgUtil/DepthSortedBin>
RegisterRenderBinProxy<DepthSortedBin> s_registerDepthSortedBinProxy;
#endif
typedef std::map< std::string, osg::ref_ptr<RenderBin> > RenderBinPrototypeList;
RenderBinPrototypeList* renderBinPrototypeList()