From 78bb0e3d8c6c4ea35bc35aada6dfb780930570b2 Mon Sep 17 00:00:00 2001 From: oy Date: Fri, 6 Jan 2012 16:35:48 +0100 Subject: fixed compiling for macosx --- src/engine/client/backend_sdl.h | 11 +++++------ src/engine/client/client.cpp | 6 ++++-- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src') 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 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(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 { -- cgit 1.4.1