about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2012-01-06 16:35:48 +0100
committeroy <Tom_Adams@web.de>2012-01-06 16:35:48 +0100
commit78bb0e3d8c6c4ea35bc35aada6dfb780930570b2 (patch)
treed4edbc8247193cc25ef27c5934c9de4183f7d79a /src
parent71dd0c5aab9b4f2dd50b3e935db764a3868de83e (diff)
downloadzcatch-78bb0e3d8c6c4ea35bc35aada6dfb780930570b2.tar.gz
zcatch-78bb0e3d8c6c4ea35bc35aada6dfb780930570b2.zip
fixed compiling for macosx
Diffstat (limited to 'src')
-rw-r--r--src/engine/client/backend_sdl.h11
-rw-r--r--src/engine/client/client.cpp6
2 files changed, 9 insertions, 8 deletions
diff --git a/src/engine/client/backend_sdl.h b/src/engine/client/backend_sdl.h
index 62ac6f7c..c6c2255a 100644
--- a/src/engine/client/backend_sdl.h
+++ b/src/engine/client/backend_sdl.h
@@ -27,25 +27,24 @@
 	static void GL_ReleaseContext(const SGLContext &Context) { wglMakeCurrent(NULL, NULL); }
 	static void GL_SwapBuffers(const SGLContext &Context) { SwapBuffers(Context.m_hDC); }
 #elif defined(CONF_PLATFORM_MACOSX)
-	#warning Untested implementation. I have no Mac OS X machine to test on. Please test, verify, fix and then remove this warning
+
+	#include <AGL/agl.h>
 
 	struct SGLContext
 	{
-		AGLDrawable m_Drawable;
 		AGLContext m_Context;
 	};
 
 	static SGLContext GL_GetCurrentContext()
 	{
 		SGLContext Context;
-		Context.m_Drawable = aglGetCurrentDrawable();
 		Context.m_Context = aglGetCurrentContext();
 		return Context;
 	}
 
-	static void GL_MakeCurrent(const SGLContext &Context) { aglMakeCurrent(Context.m_Drawable, Context.m_Context); }
-	static void GL_ReleaseContext(const SGLContext &Context) { aglMakeCurrent(AGL_NONE, NULL); }
-	static void GL_SwapBuffers(const SGLContext &Context) { aglSwapBuffers(Context.m_Drawable); }
+	static void GL_MakeCurrent(const SGLContext &Context) { aglSetCurrentContext(Context.m_Context); }
+	static void GL_ReleaseContext(const SGLContext &Context) { aglSetCurrentContext(NULL); }
+	static void GL_SwapBuffers(const SGLContext &Context) { aglSwapBuffers(Context.m_Context); }
 		
 #elif defined(CONF_FAMILY_UNIX)
 
diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp
index 35381fdf..a9c86060 100644
--- a/src/engine/client/client.cpp
+++ b/src/engine/client/client.cpp
@@ -2237,11 +2237,13 @@ static CClient *CreateClient()
 */
 
 #if defined(CONF_PLATFORM_MACOSX)
-extern "C" int SDL_main(int argc, const char **argv) // ignore_convention
+extern "C" int SDL_main(int argc, char **argv_) // ignore_convention
+{
+	const char **argv = const_cast<const char **>(argv_);
 #else
 int main(int argc, const char **argv) // ignore_convention
-#endif
 {
+#endif
 #if defined(CONF_FAMILY_WINDOWS)
 	for(int i = 1; i < argc; i++) // ignore_convention
 	{