mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
fixed compiling for macosx
This commit is contained in:
parent
71dd0c5aab
commit
78bb0e3d8c
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue