- remove the SG_GLxxxx_H #defines, since OSG provides its own versions

- this exposed a bizarre issue on Mac where dragging in <AGL/agl.h> in
   extensions.hxx was pulling in all of Carbon to the global namespace
   - very scary. As a result, I now need to explicitly include CoreFoundation
   in fg_init.cxx.
 - change SG_USING_STD(x) to using std::x

Issues:

 - the logic for X11 and Win32 in RenderTexture and extensions is tortured,
   please see if you agree I got all the ifdefs correct.
This commit is contained in:
ehofman
2008-07-27 16:10:36 +00:00
parent ff72b68731
commit c7cbb22667
15 changed files with 64 additions and 37 deletions
+1 -12
View File
@@ -131,20 +131,9 @@
// //
#ifdef __APPLE__ #ifdef __APPLE__
# define SG_GL_H <OpenGL/gl.h>
# define SG_GLX_H <AGL/agl.h>
# define SG_GLU_H <OpenGL/glu.h>
# define SG_GLEXT_H <OpenGL/glext.h>
# define SG_GLUT_H <GLUT/glut.h>
inline int (isnan)(double r) { return !(r <= 0 || r >= 0); } inline int (isnan)(double r) { return !(r <= 0 || r >= 0); }
#else #else
# define SG_GL_H <GL/gl.h>
# define SG_GLX_H <GL/glx.h>
# define SG_GLU_H <GL/glu.h>
# define SG_GLEXT_H <GL/glext.h>
# define SG_GLUT_H <GL/glut.h>
#endif #endif
+1 -1
View File
@@ -30,7 +30,7 @@
#include <simgear/scene/model/animation.hxx> #include <simgear/scene/model/animation.hxx>
#include <simgear/scene/model/model.hxx> #include <simgear/scene/model/model.hxx>
#include <simgear/environment/visual_enviro.hxx> #include <simgear/environment/visual_enviro.hxx>
#include SG_GLU_H #include <osg/GLU>
#include "shadowvolume.hxx" #include "shadowvolume.hxx"
+1 -1
View File
@@ -30,7 +30,7 @@
#include <plib/sg.h> #include <plib/sg.h>
#include <simgear/screen/extensions.hxx> #include <simgear/screen/extensions.hxx>
#include <simgear/screen/RenderTexture.h> #include <simgear/screen/RenderTexture.h>
#include SG_GLU_H #include <osg/GLU>
#include "bbcache.hxx" #include "bbcache.hxx"
+1 -1
View File
@@ -34,7 +34,7 @@
#include <simgear/misc/sg_path.hxx> #include <simgear/misc/sg_path.hxx>
#include <algorithm> #include <algorithm>
#include SG_GLU_H #include <osg/GLU>
#include "cloudfield.hxx" #include "cloudfield.hxx"
#include "newcloud.hxx" #include "newcloud.hxx"
+1 -1
View File
@@ -1,6 +1,6 @@
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include SG_GL_H #include <osg/GL>
class GlBitmap class GlBitmap
{ {
+2 -2
View File
@@ -496,7 +496,7 @@ bool RenderTexture::Initialize(int width, int height,
fprintf(stderr, "Couldn't get current context!"); fprintf(stderr, "Couldn't get current context!");
CGLPixelFormatObj pixFormat = NULL; CGLPixelFormatObj pixFormat = NULL;
long int iNumFormats; GLint iNumFormats;
CGLError error; CGLError error;
// Copy the _pixelFormatAttribs into another array to fix // Copy the _pixelFormatAttribs into another array to fix
@@ -553,7 +553,7 @@ bool RenderTexture::Initialize(int width, int height,
return false; return false;
} }
long screen; GLint screen;
if (error = CGLGetVirtualScreen(CGLGetCurrentContext(), &screen)) if (error = CGLGetVirtualScreen(CGLGetCurrentContext(), &screen))
{ {
_cglCheckError(error); _cglCheckError(error);
+7 -7
View File
@@ -50,15 +50,15 @@
*/ */
#include <simgear/compiler.h> #include <simgear/compiler.h>
#if !defined( _WIN32 ) && !defined( __MACH__ ) #include <osg/GL>
# include <X11/Xlib.h>
#endif #if defined( __APPLE__)
#include SG_GL_H
#if defined( __MACH__)
# include <OpenGL/OpenGL.h> # include <OpenGL/OpenGL.h>
#endif #endif
#ifndef _WIN32
# include SG_GLX_H #if !defined( _WIN32 ) && !defined( __APPLE__ )
# include <X11/Xlib.h>
# include <GL/glx.h>
#endif #endif
#include <string> #include <string>
+8 -2
View File
@@ -9,8 +9,14 @@
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include SG_GL_H #include <osg/GL>
#include SG_GLUT_H
#ifdef __APPLE__
# include <GLUT/glut.h>
#else
# include <GL/glut.h>
#endif
#include <simgear/screen/extensions.hxx> #include <simgear/screen/extensions.hxx>
#include <simgear/screen/RenderTexture.h> #include <simgear/screen/RenderTexture.h>
+6 -4
View File
@@ -34,11 +34,13 @@
#include <simgear/compiler.h> #include <simgear/compiler.h>
#if !defined(WIN32) #include <osg/GL>
# include SG_GLX_H
#endif
#include SG_GL_H
#if defined (WIN32)
# include <GL/wgl.h>
#elif !defined(__APPLE__)
# include <GL/glx.h>
#endif
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
+1 -1
View File
@@ -37,7 +37,7 @@
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include SG_GL_H #include <osg/GL>
#include "screen-dump.hxx" #include "screen-dump.hxx"
+1 -1
View File
@@ -23,7 +23,7 @@
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include SG_GL_H #include <osg/GL>
/** /**
* Dump the screen buffer to a ppm file. * Dump the screen buffer to a ppm file.
+1 -1
View File
@@ -17,7 +17,7 @@
# include <windows.h> # include <windows.h>
#endif #endif
#include SG_GLU_H #include <osg/GLU>
#include <math.h> #include <math.h>
#include <zlib.h> #include <zlib.h>
+1 -1
View File
@@ -14,7 +14,7 @@
#define __SG_TEXTURE_HXX 1 #define __SG_TEXTURE_HXX 1
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include SG_GL_H #include <osg/GL>
#include <zlib.h> #include <zlib.h>
#include <plib/sg.h> #include <plib/sg.h>
+16 -1
View File
@@ -2,6 +2,21 @@
/* /*
* $Log$ * $Log$
* Revision 1.5 2008/07/27 16:10:37 ehofman
*
*
* - remove the SG_GLxxxx_H #defines, since OSG provides its own versions
* - this exposed a bizarre issue on Mac where dragging in <AGL/agl.h> in
* extensions.hxx was pulling in all of Carbon to the global namespace
* - very scary. As a result, I now need to explicitly include CoreFoundation
* in fg_init.cxx.
* - change SG_USING_STD(x) to using std::x
*
* Issues:
*
* - the logic for X11 and Win32 in RenderTexture and extensions is tortured,
* please see if you agree I got all the ifdefs correct.
*
* Revision 1.4 2006/10/29 19:27:11 frohlich * Revision 1.4 2006/10/29 19:27:11 frohlich
* Modified Files: * Modified Files:
* configure.ac simgear/environment/visual_enviro.cxx * configure.ac simgear/environment/visual_enviro.cxx
@@ -129,7 +144,7 @@
#include <windows.h> #include <windows.h>
#endif #endif
#include SG_GLU_H #include <osg/GLU>
#include "tr.h" #include "tr.h"
+16 -1
View File
@@ -2,6 +2,21 @@
/* /*
* $Log$ * $Log$
* Revision 1.4 2008/07/27 16:10:37 ehofman
*
*
* - remove the SG_GLxxxx_H #defines, since OSG provides its own versions
* - this exposed a bizarre issue on Mac where dragging in <AGL/agl.h> in
* extensions.hxx was pulling in all of Carbon to the global namespace
* - very scary. As a result, I now need to explicitly include CoreFoundation
* in fg_init.cxx.
* - change SG_USING_STD(x) to using std::x
*
* Issues:
*
* - the logic for X11 and Win32 in RenderTexture and extensions is tortured,
* please see if you agree I got all the ifdefs correct.
*
* Revision 1.3 2006/02/21 10:47:21 ehofman * Revision 1.3 2006/02/21 10:47:21 ehofman
* Back out the previous patch. * Back out the previous patch.
* *
@@ -85,7 +100,7 @@
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include SG_GL_H #include <osg/GL>
//#ifdef __cplusplus //#ifdef __cplusplus