diff --git a/standard/inc/StdGL.h b/standard/inc/StdGL.h index e82b279ca..ead465ead 100644 --- a/standard/inc/StdGL.h +++ b/standard/inc/StdGL.h @@ -24,14 +24,6 @@ #include -#ifdef USE_X11 -// Xmd.h typedefs BOOL to CARD8, but we want int -#define BOOL _BOOL -#include -#undef BOOL -#include -#endif - #if defined(__APPLE__) #include #else @@ -69,7 +61,7 @@ class CStdGLCtx HWND hWindow; // used if pWindow==NULL HDC hDC; // device context handle #elif defined(USE_X11) - GLXContext ctx; + /*GLXContext*/void * ctx; #endif int cx,cy; // context window size diff --git a/standard/src/StdGLCtx.cpp b/standard/src/StdGLCtx.cpp index 06dca3bff..5d7b667d4 100644 --- a/standard/src/StdGLCtx.cpp +++ b/standard/src/StdGLCtx.cpp @@ -193,7 +193,12 @@ bool CStdGL::ApplyGammaRamp(D3DGAMMARAMP &ramp, bool fForce) #elif defined(USE_X11) +// Xmd.h typedefs BOOL to CARD8, whereas microsoft windows and Clonk use int +#define BOOL _BOOL +#include +#include #include +#undef BOOL CStdGLCtx::CStdGLCtx(): pWindow(0), ctx(0), cx(0), cy(0) { } @@ -202,7 +207,7 @@ void CStdGLCtx::Clear() Deselect(); if (ctx) { - glXDestroyContext(pWindow->dpy, ctx); + glXDestroyContext(pWindow->dpy, (GLXContext)ctx); ctx = 0; } pWindow = 0; @@ -218,10 +223,10 @@ bool CStdGLCtx::Init(CStdWindow * pWindow, CStdApp *) // Create Context with sharing (if this is the main context, our ctx will be 0, so no sharing) // try direct rendering first if (!DDrawCfg.NoAcceleration) - ctx = glXCreateContext(pWindow->dpy, (XVisualInfo*)pWindow->Info, pGL->MainCtx.ctx, True); + ctx = glXCreateContext(pWindow->dpy, (XVisualInfo*)pWindow->Info, (GLXContext)pGL->MainCtx.ctx, True); // without, rendering will be unacceptable slow, but that's better than nothing at all if (!ctx) - ctx = glXCreateContext(pWindow->dpy, (XVisualInfo*)pWindow->Info, pGL->MainCtx.ctx, False); + ctx = glXCreateContext(pWindow->dpy, (XVisualInfo*)pWindow->Info, (GLXContext)pGL->MainCtx.ctx, False); // No luck at all? if (!ctx) return pGL->Error(" gl: Unable to create context"); if (!Select(true)) return pGL->Error(" gl: Unable to select context"); @@ -249,7 +254,7 @@ bool CStdGLCtx::Select(bool verbose) return false; } // make context current - if (!pWindow->renderwnd || !glXMakeCurrent(pWindow->dpy, pWindow->renderwnd, ctx)) + if (!pWindow->renderwnd || !glXMakeCurrent(pWindow->dpy, pWindow->renderwnd, (GLXContext)ctx)) { if (verbose) pGL->Error(" gl: glXMakeCurrent failed"); return false; diff --git a/standard/src/StdXWindow.cpp b/standard/src/StdXWindow.cpp index 7d1c52638..b4c5a7247 100644 --- a/standard/src/StdXWindow.cpp +++ b/standard/src/StdXWindow.cpp @@ -30,11 +30,14 @@ #include "../../engine/inc/C4Version.h" #ifdef USE_X11 +#define BOOL _BOOL #include "../../engine/res/c4x.xpm" #include #include #include #include +#include +#undef BOOL #endif #include