X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGame.h;h=d5978de94d2fde3bb52aa909ce82d3f627e0e117;hb=c33352410441ce5656f7c65eea696b5f799fefeb;hp=a112d0a47697684f893d76897686707bd8f8b763;hpb=36cc3af3e5074215817ddee16defde754e2ad67f;p=lugaru.git diff --git a/Source/Game.h b/Source/Game.h index a112d0a..d5978de 100644 --- a/Source/Game.h +++ b/Source/Game.h @@ -10,14 +10,17 @@ //#include #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" @@ -38,15 +41,6 @@ extern GLuint rabbittexture; -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - - class Game { public: @@ -279,4 +273,36 @@ public: }; +#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