about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2012-01-03 22:49:31 +0100
committerMagnus Auvinen <magnus.auvinen@gmail.com>2012-01-03 22:49:31 +0100
commit666401e309e21b30285bc2545038a624c1c023eb (patch)
treedcfa1b286e53b26a19e2539e2cc6d63378333df8
parent2991f4071e50cca641044376dc2196d9dcfff80d (diff)
downloadzcatch-666401e309e21b30285bc2545038a624c1c023eb.tar.gz
zcatch-666401e309e21b30285bc2545038a624c1c023eb.zip
added osx implementation. not tested, not even compiled once. hope it works
-rw-r--r--src/engine/client/backend_sdl.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/engine/client/backend_sdl.h b/src/engine/client/backend_sdl.h
index de0c6bd4..ca3ae3e5 100644
--- a/src/engine/client/backend_sdl.h
+++ b/src/engine/client/backend_sdl.h
@@ -27,7 +27,26 @@
 	static void GL_ReleaseContext(const SGLContext &Context) { wglMakeCurrent(Context.m_hDC, NULL); }
 	static void GL_SwapBuffers(const SGLContext &Context) { SwapBuffers(Context.m_hDC); }
 #elif defined(CONF_PLATFORM_MACOSX)
-	#error missing implementation
+	#warning Untested implementation. I have no Mac OS X machine to test on. Please test, verify, fix and then remove this warning
+
+	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(Context.m_Drawable, NULL); }
+	static void GL_SwapBuffers(const SGLContext &Context) { aglSwapBuffers(Context.m_Drawable); }
+		
 #elif defined(CONF_FAMILY_UNIX)
 
 	#include <GL/glx.h>