aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pugl/pugl_win.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/pugl/pugl_win.c b/pugl/pugl_win.c
index 516b094..8371b1e 100644
--- a/pugl/pugl_win.c
+++ b/pugl/pugl_win.c
@@ -117,27 +117,28 @@ puglInitInternals(void)
void
puglEnterContext(PuglView* view)
{
- PAINTSTRUCT ps;
- BeginPaint(view->impl->hwnd, &ps);
-
#ifdef PUGL_HAVE_GL
if (view->ctx_type == PUGL_GL) {
wglMakeCurrent(view->impl->hdc, view->impl->hglrc);
}
#endif
+
+ PAINTSTRUCT ps;
+ BeginPaint(view->impl->hwnd, &ps);
}
void
puglLeaveContext(PuglView* view, bool flush)
{
+ PAINTSTRUCT ps;
+ EndPaint(view->impl->hwnd, &ps);
+
#ifdef PUGL_HAVE_GL
if (view->ctx_type == PUGL_GL && flush) {
SwapBuffers(view->impl->hdc);
}
#endif
- PAINTSTRUCT ps;
- EndPaint(view->impl->hwnd, &ps);
}
static PIXELFORMATDESCRIPTOR