From c7cbb22667c901e6107dd099e02e9506f9fbd360 Mon Sep 17 00:00:00 2001 From: ehofman Date: Sun, 27 Jul 2008 16:10:36 +0000 Subject: [PATCH] - remove the SG_GLxxxx_H #defines, since OSG provides its own versions - this exposed a bizarre issue on Mac where dragging in 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. --- simgear/compiler.h | 13 +------------ simgear/scene/model/shadowvolume.cxx | 2 +- simgear/scene/sky/bbcache.cxx | 2 +- simgear/scene/sky/newcloud.cxx | 2 +- simgear/screen/GLBitmaps.h | 2 +- simgear/screen/RenderTexture.cpp | 4 ++-- simgear/screen/RenderTexture.h | 14 +++++++------- simgear/screen/TestRenderTexture.cpp | 10 ++++++++-- simgear/screen/extensions.hxx | 10 ++++++---- simgear/screen/screen-dump.cxx | 2 +- simgear/screen/screen-dump.hxx | 2 +- simgear/screen/texture.cxx | 2 +- simgear/screen/texture.hxx | 2 +- simgear/screen/tr.cxx | 17 ++++++++++++++++- simgear/screen/tr.h | 17 ++++++++++++++++- 15 files changed, 64 insertions(+), 37 deletions(-) diff --git a/simgear/compiler.h b/simgear/compiler.h index beb409fd..7d2e6da5 100644 --- a/simgear/compiler.h +++ b/simgear/compiler.h @@ -131,20 +131,9 @@ // #ifdef __APPLE__ -# define SG_GL_H -# define SG_GLX_H -# define SG_GLU_H -# define SG_GLEXT_H -# define SG_GLUT_H - - inline int (isnan)(double r) { return !(r <= 0 || r >= 0); } #else -# define SG_GL_H -# define SG_GLX_H -# define SG_GLU_H -# define SG_GLEXT_H -# define SG_GLUT_H + #endif diff --git a/simgear/scene/model/shadowvolume.cxx b/simgear/scene/model/shadowvolume.cxx index 970fe3e7..3a164a16 100644 --- a/simgear/scene/model/shadowvolume.cxx +++ b/simgear/scene/model/shadowvolume.cxx @@ -30,7 +30,7 @@ #include #include #include -#include SG_GLU_H +#include #include "shadowvolume.hxx" diff --git a/simgear/scene/sky/bbcache.cxx b/simgear/scene/sky/bbcache.cxx index 420b0e8d..66b27275 100644 --- a/simgear/scene/sky/bbcache.cxx +++ b/simgear/scene/sky/bbcache.cxx @@ -30,7 +30,7 @@ #include #include #include -#include SG_GLU_H +#include #include "bbcache.hxx" diff --git a/simgear/scene/sky/newcloud.cxx b/simgear/scene/sky/newcloud.cxx index d15b4561..9eb5d20d 100644 --- a/simgear/scene/sky/newcloud.cxx +++ b/simgear/scene/sky/newcloud.cxx @@ -34,7 +34,7 @@ #include #include -#include SG_GLU_H +#include #include "cloudfield.hxx" #include "newcloud.hxx" diff --git a/simgear/screen/GLBitmaps.h b/simgear/screen/GLBitmaps.h index f6fb05f4..bc92e33d 100644 --- a/simgear/screen/GLBitmaps.h +++ b/simgear/screen/GLBitmaps.h @@ -1,6 +1,6 @@ #include -#include SG_GL_H +#include class GlBitmap { diff --git a/simgear/screen/RenderTexture.cpp b/simgear/screen/RenderTexture.cpp index ec6a8e89..0e5ba9ef 100644 --- a/simgear/screen/RenderTexture.cpp +++ b/simgear/screen/RenderTexture.cpp @@ -496,7 +496,7 @@ bool RenderTexture::Initialize(int width, int height, fprintf(stderr, "Couldn't get current context!"); CGLPixelFormatObj pixFormat = NULL; - long int iNumFormats; + GLint iNumFormats; CGLError error; // Copy the _pixelFormatAttribs into another array to fix @@ -553,7 +553,7 @@ bool RenderTexture::Initialize(int width, int height, return false; } - long screen; + GLint screen; if (error = CGLGetVirtualScreen(CGLGetCurrentContext(), &screen)) { _cglCheckError(error); diff --git a/simgear/screen/RenderTexture.h b/simgear/screen/RenderTexture.h index 5d68a02c..a1874fbc 100644 --- a/simgear/screen/RenderTexture.h +++ b/simgear/screen/RenderTexture.h @@ -50,15 +50,15 @@ */ #include -#if !defined( _WIN32 ) && !defined( __MACH__ ) -# include -#endif -#include SG_GL_H -#if defined( __MACH__) +#include + +#if defined( __APPLE__) # include #endif -#ifndef _WIN32 -# include SG_GLX_H + +#if !defined( _WIN32 ) && !defined( __APPLE__ ) +# include +# include #endif #include diff --git a/simgear/screen/TestRenderTexture.cpp b/simgear/screen/TestRenderTexture.cpp index 2c7fc236..2aa2e09f 100644 --- a/simgear/screen/TestRenderTexture.cpp +++ b/simgear/screen/TestRenderTexture.cpp @@ -9,8 +9,14 @@ #include -#include SG_GL_H -#include SG_GLUT_H +#include + +#ifdef __APPLE__ +# include +#else +# include +#endif + #include #include diff --git a/simgear/screen/extensions.hxx b/simgear/screen/extensions.hxx index 41965588..a0c09fd4 100644 --- a/simgear/screen/extensions.hxx +++ b/simgear/screen/extensions.hxx @@ -34,11 +34,13 @@ #include -#if !defined(WIN32) -# include SG_GLX_H -#endif -#include SG_GL_H +#include +#if defined (WIN32) +# include +#elif !defined(__APPLE__) +# include +#endif #if defined(__cplusplus) extern "C" { diff --git a/simgear/screen/screen-dump.cxx b/simgear/screen/screen-dump.cxx index 8e23b8f2..b74f06c0 100644 --- a/simgear/screen/screen-dump.cxx +++ b/simgear/screen/screen-dump.cxx @@ -37,7 +37,7 @@ #include -#include SG_GL_H +#include #include "screen-dump.hxx" diff --git a/simgear/screen/screen-dump.hxx b/simgear/screen/screen-dump.hxx index 379802b1..25a4c196 100644 --- a/simgear/screen/screen-dump.hxx +++ b/simgear/screen/screen-dump.hxx @@ -23,7 +23,7 @@ #include -#include SG_GL_H +#include /** * Dump the screen buffer to a ppm file. diff --git a/simgear/screen/texture.cxx b/simgear/screen/texture.cxx index fd4aaf89..6f744c35 100644 --- a/simgear/screen/texture.cxx +++ b/simgear/screen/texture.cxx @@ -17,7 +17,7 @@ # include #endif -#include SG_GLU_H +#include #include #include diff --git a/simgear/screen/texture.hxx b/simgear/screen/texture.hxx index 9f76cadb..bdded366 100644 --- a/simgear/screen/texture.hxx +++ b/simgear/screen/texture.hxx @@ -14,7 +14,7 @@ #define __SG_TEXTURE_HXX 1 #include -#include SG_GL_H +#include #include #include diff --git a/simgear/screen/tr.cxx b/simgear/screen/tr.cxx index 85e9f3a8..6c191a3d 100644 --- a/simgear/screen/tr.cxx +++ b/simgear/screen/tr.cxx @@ -2,6 +2,21 @@ /* * $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 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 * Modified Files: * configure.ac simgear/environment/visual_enviro.cxx @@ -129,7 +144,7 @@ #include #endif -#include SG_GLU_H +#include #include "tr.h" diff --git a/simgear/screen/tr.h b/simgear/screen/tr.h index 8ef88bac..57c13959 100644 --- a/simgear/screen/tr.h +++ b/simgear/screen/tr.h @@ -2,6 +2,21 @@ /* * $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 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 * Back out the previous patch. * @@ -85,7 +100,7 @@ #include -#include SG_GL_H +#include //#ifdef __cplusplus -- 2.39.5