diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/engine/client/backend_sdl.h | 11 | ||||
| -rw-r--r-- | src/engine/client/client.cpp | 6 |
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 { |