diff options
Diffstat (limited to 'pugl/pugl_win.c')
-rw-r--r-- | pugl/pugl_win.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/pugl/pugl_win.c b/pugl/pugl_win.c index 747a1f4..d9cdf7d 100644 --- a/pugl/pugl_win.c +++ b/pugl/pugl_win.c @@ -115,7 +115,7 @@ puglInitInternals(void) } void -puglEnterContext(PuglView* view) +puglEnterContext(PuglView* view, bool drawing) { #ifdef PUGL_HAVE_GL if (view->ctx_type == PUGL_GL) { @@ -123,19 +123,23 @@ puglEnterContext(PuglView* view) } #endif - PAINTSTRUCT ps; - BeginPaint(view->impl->hwnd, &ps); + if (drawing) { + PAINTSTRUCT ps; + BeginPaint(view->impl->hwnd, &ps); + } } void -puglLeaveContext(PuglView* view, bool flush) +puglLeaveContext(PuglView* view, bool drawing) { - PAINTSTRUCT ps; - EndPaint(view->impl->hwnd, &ps); + if (drawing) { + PAINTSTRUCT ps; + EndPaint(view->impl->hwnd, &ps); #ifdef PUGL_HAVE_GL - if (view->ctx_type == PUGL_GL && flush) { - SwapBuffers(view->impl->hdc); + if (view->ctx_type == PUGL_GL) { + SwapBuffers(view->impl->hdc); + } } #endif |