From 581cd286d4cb1662e4d228faddc8999c93e5ed3a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 25 Jul 2019 10:19:55 +0200 Subject: Windows: Fix initial display once again I have no idea why this affects anything, but it seems to fix this, this time, again. One of these days I'll get it right. --- pugl/pugl_win.c | 11 ++++++----- 1 file 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 -- cgit v1.2.1