Integrated changes for MacOSX, submitted by Phil Atkin, with small mods by
Robert Osfield to maintain compatability under Linux.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/ReadFile>
|
||||
|
||||
#include <GL/glut.h>
|
||||
#include <osgGLUT/glut>
|
||||
#include <osgGLUT/Viewer>
|
||||
|
||||
#include "GliderManipulator.h"
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#pragma warning( disable : 4244 )
|
||||
#endif
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <math.h>
|
||||
#include <osg/GL>
|
||||
#include <osg/Math>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "terrain_data.h"
|
||||
|
||||
@@ -10,10 +10,9 @@
|
||||
#include <osgUtil/TrackballManipulator>
|
||||
|
||||
#include <osgGLUT/Viewer>
|
||||
#include <osgGLUT/glut>
|
||||
|
||||
#include <GL/glut.h>
|
||||
|
||||
#include <math.h>
|
||||
#include <osg/Math>
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Global variables - this is basically the stuff which will be animated
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/ReadFile>
|
||||
|
||||
#include <GL/glut.h>
|
||||
#include <osgGLUT/glut>
|
||||
#include <osgGLUT/Viewer>
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <osgUtil/FlightManipulator>
|
||||
#include <osgUtil/DriveManipulator>
|
||||
|
||||
#include <GL/glut.h>
|
||||
#include <osgGLUT/glut>
|
||||
#include <osgGLUT/Viewer>
|
||||
|
||||
#include <osgUtil/OptimizeStateVisitor>
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#include "osg/Image"
|
||||
#include "osg/GL"
|
||||
#include "osg/Notify"
|
||||
#include <osg/GL>
|
||||
#include <osg/GLU>
|
||||
|
||||
#include <osg/Image>
|
||||
#include <osg/Notify>
|
||||
|
||||
#include <osg/Geode>
|
||||
#include <osg/GeoSet>
|
||||
#include <osg/StateSet>
|
||||
#include <osg/Texture>
|
||||
|
||||
#include <GL/glu.h>
|
||||
|
||||
using namespace osg;
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include <string>
|
||||
|
||||
osg::NotifySeverity osg::g_NotifyLevel = osg::NOTICE;
|
||||
ofstream *osg::g_NotifyNulStream;
|
||||
bool osg::g_NotifyInit = false;
|
||||
|
||||
void osg::setNotifyLevel(osg::NotifySeverity severity)
|
||||
{
|
||||
@@ -19,11 +21,16 @@ osg::NotifySeverity osg::getNotifyLevel()
|
||||
|
||||
bool osg::initNotifyLevel()
|
||||
{
|
||||
static bool s_local_intialized = false;
|
||||
if (g_NotifyInit) return true;
|
||||
|
||||
if (s_local_intialized) return true;
|
||||
|
||||
s_local_intialized = true;
|
||||
g_NotifyInit = true;
|
||||
|
||||
// set up global notify null stream for inline notify
|
||||
#ifdef WIN32
|
||||
g_NotifyNulStream = new ofstream ("nul");
|
||||
#else
|
||||
g_NotifyNulStream = new ofstream ("/dev/null");
|
||||
#endif
|
||||
|
||||
// g_NotifyLevel
|
||||
// =============
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <osg/State>
|
||||
#include <osg/Notify>
|
||||
|
||||
#include <GL/glu.h>
|
||||
#include <osg/GLU>
|
||||
|
||||
using namespace osg;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <osg/Notify>
|
||||
#include <osg/GLExtensions>
|
||||
|
||||
#include <GL/glu.h>
|
||||
#include <osg/GLU>
|
||||
|
||||
using namespace osg;
|
||||
|
||||
@@ -176,7 +176,7 @@ void Texture::apply(State& state) const
|
||||
const uint contextID = state.getContextID();
|
||||
|
||||
// get the globj for the current contextID.
|
||||
uint& handle = getHandle(contextID);
|
||||
GLuint& handle = getHandle(contextID);
|
||||
|
||||
// For multi-texturing will need something like...
|
||||
// glActiveTextureARB((GLenum)(GL_TEXTURE0_ARB+_textureUnit));
|
||||
@@ -548,7 +548,7 @@ void Texture::copyTexSubImage2D(State& state, int xoffset, int yoffset, int x, i
|
||||
const uint contextID = state.getContextID();
|
||||
|
||||
// get the globj for the current contextID.
|
||||
uint& handle = getHandle(contextID);
|
||||
GLuint& handle = getHandle(contextID);
|
||||
|
||||
if (handle)
|
||||
{
|
||||
|
||||
@@ -180,7 +180,23 @@ using namespace osg;
|
||||
_secsPerClick = (double)(cycleval)* 1e-12;
|
||||
}
|
||||
}
|
||||
#elif defined (__APPLE_CC__) // MACOSX PJA
|
||||
#include <Carbon/Carbon.h> // do I really have to link against the Carbon framework just for this?
|
||||
|
||||
Timer_t Timer::tick(void)
|
||||
{
|
||||
UnsignedWide usecs;
|
||||
Microseconds(&usecs);
|
||||
|
||||
return (usecs.hi * 4294967296.0) + usecs.lo;
|
||||
}
|
||||
|
||||
Timer::Timer( void )
|
||||
{
|
||||
_useStandardClock = false;
|
||||
_secsPerClick = 1e-6; // Carbon timer's precision.
|
||||
|
||||
}
|
||||
|
||||
#elif defined(unix)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "osgGLUT/GLUTEventAdapter"
|
||||
#include "GL/glut.h"
|
||||
#include <osgGLUT/glut>
|
||||
|
||||
using namespace osgGLUT;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <osg/Math>
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#define USE_GLUT
|
||||
#endif
|
||||
|
||||
#include <GL/glut.h>
|
||||
#include <osgGLUT/glut>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <sys/timeb.h>
|
||||
@@ -1049,7 +1049,7 @@ void Viewer::keyboard(unsigned char key, int x, int y)
|
||||
if (_printStats>4) _printStats=0;
|
||||
if (_printStats==4) { // count depth complexity by incrementing the stencil buffer every
|
||||
// time a pixel is hit
|
||||
int nsten=0; // Number of stencil planes available
|
||||
GLint nsten=0; // Number of stencil planes available
|
||||
glGetIntegerv(GL_STENCIL_BITS , &nsten);
|
||||
if (nsten>0) {
|
||||
glEnable(GL_STENCIL_TEST);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <osg/AlphaFunc>
|
||||
#include <osg/TexEnv>
|
||||
|
||||
#include <GL/glu.h>
|
||||
#include <osg/GLU>
|
||||
|
||||
using namespace osg;
|
||||
using namespace osgUtil;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#include <osg/GL>
|
||||
#include <osg/GLU>
|
||||
|
||||
#include <osg/Notify>
|
||||
#include <osgUtil/Tesselator>
|
||||
|
||||
#include <GL/glu.h>
|
||||
|
||||
|
||||
using namespace osg;
|
||||
using namespace osgUtil;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user