Browse Source

Clear GL context in puglLeaveContext

pull/6/head
falkTX 9 years ago
parent
commit
327f69dfc8
2 changed files with 13 additions and 7 deletions
  1. +6
    -3
      dgl/src/pugl/pugl_win.cpp
  2. +7
    -4
      dgl/src/pugl/pugl_x11.c

+ 6
- 3
dgl/src/pugl/pugl_win.cpp View File

@@ -87,9 +87,12 @@ void
puglLeaveContext(PuglView* view, bool flush)
{
#ifdef PUGL_HAVE_GL
if (view->ctx_type == PUGL_GL && flush) {
glFlush();
SwapBuffers(view->impl->hdc);
if (view->ctx_type == PUGL_GL) {
if (flush) {
glFlush();
SwapBuffers(view->impl->hdc);
}
wglMakeCurrent(NULL, NULL);
}
#endif
}


+ 7
- 4
dgl/src/pugl/pugl_x11.c View File

@@ -218,11 +218,14 @@ void
puglLeaveContext(PuglView* view, bool flush)
{
#ifdef PUGL_HAVE_GL
if (view->ctx_type == PUGL_GL && flush) {
glFlush();
if (view->impl->doubleBuffered) {
glXSwapBuffers(view->impl->display, view->impl->win);
if (view->ctx_type == PUGL_GL) {
if (flush) {
glFlush();
if (view->impl->doubleBuffered) {
glXSwapBuffers(view->impl->display, view->impl->win);
}
}
glXMakeCurrent(view->impl->display, None, NULL);
}
#endif
}


Loading…
Cancel
Save