Skip to content

Commit

Permalink
GL|Unix: Assert GL context activate with Qt
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Apr 13, 2012
1 parent 52140fb commit 8cb4225
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 4 additions & 3 deletions doomsday/engine/portable/src/gl_main.c
Expand Up @@ -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.
Expand Down
9 changes: 9 additions & 0 deletions doomsday/engine/portable/src/window.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 8cb4225

Please sign in to comment.