]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Game.h
Fixed resolution selection and added 1920x1200 mode for my monitor. :)
[lugaru.git] / Source / Game.h
index 6a7644cab4a57327377436ea30874c863b5b7b87..d5978de94d2fde3bb52aa909ce82d3f627e0e117 100644 (file)
@@ -1,25 +1,26 @@
 #ifndef _GAME_H_
 #define _GAME_H_
 
-#ifndef WIN32
 #ifdef PLATFORM_MACOSX
 #include <Carbon.h>
 #include "Quicktime.h"
 #endif
-#endif
 
 //Jordan included glut.h
 //#include <glut.h>
 
 #include "TGALoader.h"
-#ifdef WIN32
-#include "WinInput.h"
-#elif USE_SDL
+
+#if USE_SDL
 #include "SDL.h"
-//#include "SDLInput.h"
+#endif
+
+#if !PLATFORM_MACOSX
+#include "WinInput.h"
 #else
 #include "Macinput.h"
 #endif
+
 #include "Terrain.h"
 #include "Skybox.h"
 #include "Skeleton.h"
@@ -40,7 +41,6 @@
 
 extern GLuint rabbittexture;
 
-
 class Game             
 {
 public:
@@ -273,4 +273,36 @@ public:
 
 };
 
-#endif
\ No newline at end of file
+#ifndef __forceinline
+#  ifdef __GNUC__
+#    define __forceinline inline __attribute__((always_inline))
+#  endif
+#endif
+
+static __forceinline void swap_gl_buffers(void)
+{
+#ifdef WIN32
+    extern HDC hDC;
+    SwapBuffers( hDC);
+#elif USE_SDL
+    SDL_GL_SwapBuffers();
+#elif PLATFORM_MACOSX
+    extern AGLContext gaglContext;
+    aglSwapBuffers(gaglContext);
+#else
+    #error define your platform.
+#endif
+}
+
+#ifdef __GNUC__
+#define LONGLONGCONST(x) (x##ll)
+#else
+#define LONGLONGCONST(x) (x)
+#endif
+
+extern "C" { void UndefinedSymbolToExposeStubbedCode(void); }
+//#define STUBBED(x) UndefinedSymbolToExposeStubbedCode();
+#define STUBBED(x) { static bool seen = false; if (!seen) { seen = true; fprintf(stderr, "STUBBED: %s at %s:%d\n", x, __FILE__, __LINE__); } }
+//#define STUBBED(x)
+
+#endif