DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit 327f69dfc85141fa5597063c060e03ae71d34c11
parent 62801adfc8c46199d87b2508f523c42c31a30146
Author: falkTX <falktx@gmail.com>
Date:   Mon, 19 Oct 2015 13:27:36 +0200

Clear GL context in puglLeaveContext

Diffstat:
Mdgl/src/pugl/pugl_win.cpp | 9++++++---
Mdgl/src/pugl/pugl_x11.c | 11+++++++----
2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/dgl/src/pugl/pugl_win.cpp b/dgl/src/pugl/pugl_win.cpp @@ -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 } diff --git a/dgl/src/pugl/pugl_x11.c b/dgl/src/pugl/pugl_x11.c @@ -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 }