#ifndef _GAME_H_
#define _GAME_H_
-#ifndef WIN32
+#ifdef PLATFORM_MACOSX
#include <Carbon.h>
#include "Quicktime.h"
#endif
+
//Jordan included glut.h
//#include <glut.h>
#include "TGALoader.h"
-#ifdef WIN32
+
+#if USE_SDL
+#include "SDL.h"
+#endif
+
+#if !PLATFORM_MACOSX
#include "WinInput.h"
#else
#include "Macinput.h"
#endif
+
#include "Terrain.h"
#include "Skybox.h"
#include "Skeleton.h"
#include "Weapons.h"
#include "binio.h"
#include <fstream>
-#include "gl.h"
+#include "gamegl.h"
extern GLuint rabbittexture;
-
class Game
{
public:
Game();
~Game() {
for(int i=0;i<10;i++){
- if(Mainmenuitems[i])glDeleteTextures( 1, (const unsigned long *)&Mainmenuitems[i] );
+ if(Mainmenuitems[i])glDeleteTextures( 1, &Mainmenuitems[i] );
}
- glDeleteTextures( 1, (const unsigned long *)&cursortexture );
- glDeleteTextures( 1, (const unsigned long *)&Maparrowtexture );
- glDeleteTextures( 1, (const unsigned long *)&Mapboxtexture );
- glDeleteTextures( 1, (const unsigned long *)&Mapcircletexture );
- glDeleteTextures( 1, (const unsigned long *)&terraintexture );
- glDeleteTextures( 1, (const unsigned long *)&terraintexture2 );
- if(screentexture>0)glDeleteTextures( 1, (const unsigned long *)&screentexture );
- if(screentexture2>0)glDeleteTextures( 1, (const unsigned long *)&screentexture2 );
- glDeleteTextures( 1, (const unsigned long *)&hawktexture );
- glDeleteTextures( 1, (const unsigned long *)&logotexture );
- glDeleteTextures( 1, (const unsigned long *)&loadscreentexture );
+ glDeleteTextures( 1, &cursortexture );
+ glDeleteTextures( 1, &Maparrowtexture );
+ glDeleteTextures( 1, &Mapboxtexture );
+ glDeleteTextures( 1, &Mapcircletexture );
+ glDeleteTextures( 1, &terraintexture );
+ glDeleteTextures( 1, &terraintexture2 );
+ if(screentexture>0)glDeleteTextures( 1, &screentexture );
+ if(screentexture2>0)glDeleteTextures( 1, &screentexture2 );
+ glDeleteTextures( 1, &hawktexture );
+ glDeleteTextures( 1, &logotexture );
+ glDeleteTextures( 1, &loadscreentexture );
Dispose();
}
};
-#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