From 8cb4225f4401c6e95dc7af0313b6e727db817f5d Mon Sep 17 00:00:00 2001 From: skyjake Date: Fri, 13 Apr 2012 11:10:22 +0300 Subject: [PATCH] GL|Unix: Assert GL context activate with Qt --- doomsday/engine/portable/src/gl_main.c | 7 ++++--- doomsday/engine/portable/src/window.cpp | 9 +++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doomsday/engine/portable/src/gl_main.c b/doomsday/engine/portable/src/gl_main.c index 50a7e5a854..f37085b2db 100644 --- a/doomsday/engine/portable/src/gl_main.c +++ b/doomsday/engine/portable/src/gl_main.c @@ -185,15 +185,16 @@ boolean GL_IsInited(void) return initGLOk; } +#if defined(WIN32) || defined(MACOSX) void GL_AssertContextActive(void) { -#ifdef MACOSX - assert(CGLGetCurrentContext() != 0); -#endif #ifdef WIN32 assert(wglGetCurrentContext() != 0); +#else + assert(CGLGetCurrentContext() != 0); #endif } +#endif /** * Swaps buffers / blits the back buffer to the front. diff --git a/doomsday/engine/portable/src/window.cpp b/doomsday/engine/portable/src/window.cpp index b4c6fdfbd6..ce3b74d7f4 100644 --- a/doomsday/engine/portable/src/window.cpp +++ b/doomsday/engine/portable/src/window.cpp @@ -1314,6 +1314,15 @@ void Window_UpdateCanvasFormat(Window* wnd) wnd->needRecreateCanvas = true; } +#if defined(UNIX) && !defined(MACOSX) +void GL_AssertContextActive(void) +{ + Window* wnd = Window_Main(); + if(wnd->type == WT_CONSOLE) return; + assert(QGLContext::currentContext() != 0); +} +#endif + void Window_GLActivate(Window* wnd) { if(wnd->type == WT_CONSOLE) return;