Fix minor syntax error, move all OpenGL includes into a new file that can detect the OS X version.

This commit is contained in:
Simon Robertshaw 2012-05-30 13:17:40 +01:00
parent 86746f38b0
commit ab82847cd6
4 changed files with 31 additions and 25 deletions

View File

@ -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"

24
src/OpenGLHeaders.h Normal file
View File

@ -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

View File

@ -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

View File

@ -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"