diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-05-30 12:17:40 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-05-30 12:17:40 (GMT) |
| commit | ab82847cd604bdaff9f458321b57f7ec8aa410a0 (patch) | |
| tree | 38fbe8ae3f3ab79cc2c65f54d757b1fec7ce5552 /src | |
| parent | 86746f38b0c0f382f06eb11c59b3dc49641490aa (diff) | |
| download | powder-ab82847cd604bdaff9f458321b57f7ec8aa410a0.zip powder-ab82847cd604bdaff9f458321b57f7ec8aa410a0.tar.gz | |
Fix minor syntax error, move all OpenGL includes into a new file that can detect the OS X version.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Graphics.h | 13 | ||||
| -rw-r--r-- | src/OpenGLHeaders.h | 24 | ||||
| -rw-r--r-- | src/PowderToySDL.cpp | 6 | ||||
| -rw-r--r-- | src/Renderer.h | 13 |
4 files changed, 31 insertions, 25 deletions
diff --git a/src/Graphics.h b/src/Graphics.h index d3f891c..f404d40 100644 --- a/src/Graphics.h +++ b/src/Graphics.h @@ -4,18 +4,7 @@ #include "SDL.h" #include <string> #if defined(OGLR) -#ifdef MACOSX -#include <OpenGL/gl3.h> -#include <OpenGL/glu.h> -#elif defined(WIN32) -#include <GL/glew.h> -#include <GL/gl.h> -#include <GL/glu.h> -#else -//#include <GL/glew.h> -#include <GL/gl.h> -#include <GL/glu.h> -#endif +#include "OpenGLHeaders.h" #endif #include "Config.h" //#include "powder.h" diff --git a/src/OpenGLHeaders.h b/src/OpenGLHeaders.h new file mode 100644 index 0000000..3f925ac --- /dev/null +++ b/src/OpenGLHeaders.h @@ -0,0 +1,24 @@ +#ifdef MACOSX + +#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 +#include <OpenGL/gl3.h> +#include <OpenGL/glu.h> +#else +//#include <GL/glew.h> +#include <OpenGL/gl.h> +#include <OpenGL/glu.h> +#define GL_RGBA32F 0x8814 +#endif + +#elif defined(WIN32) + +#include <GL/glew.h> +#include <GL/gl.h> +#include <GL/glu.h> + +#else + +//#include <GL/glew.h> +#include <GL/gl.h> +#include <GL/glu.h> +#endif
\ No newline at end of file diff --git a/src/PowderToySDL.cpp b/src/PowderToySDL.cpp index 8ec1abd..0229103 100644 --- a/src/PowderToySDL.cpp +++ b/src/PowderToySDL.cpp @@ -1,3 +1,4 @@ +#ifdef USE_SDL #include <time.h> #include "SDL.h" @@ -62,8 +63,8 @@ void blit(pixel * vid) SDL_UnlockSurface(sdl_scrn); SDL_UpdateRect(sdl_scrn,0,0,0,0); } -#endif } +#endif SDL_Surface * SDLOpen() { @@ -228,4 +229,7 @@ int main(int argc, char * argv[]) ui::Engine::Ref().CloseWindow(); delete gameController; delete ui::Engine::Ref().g; + return 0; } + +#endif diff --git a/src/Renderer.h b/src/Renderer.h index bc91903..08befa6 100644 --- a/src/Renderer.h +++ b/src/Renderer.h @@ -3,18 +3,7 @@ #include <vector> #if defined(OGLR) -#ifdef MACOSX -#include <OpenGL/gl3.h> -#include <OpenGL/glu.h> -#elif defined(WIN32) -#include <GL/glew.h> -#include <GL/gl.h> -#include <GL/glu.h> -#else -//#include <GL/glew.h> -#include <GL/gl.h> -#include <GL/glu.h> -#endif +#include "OpenGLHeaders.h" #endif #include "Config.h" |
