diff options
author | David Robillard <d@drobilla.net> | 2019-07-25 10:19:55 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-07-25 10:26:19 +0200 |
commit | 581cd286d4cb1662e4d228faddc8999c93e5ed3a (patch) | |
tree | d09e2173434c0a4a7b514e15ee06c3597482667c | |
parent | bba5958e3d0b82c22befaa02585d76abad4b0bd0 (diff) |
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.
-rw-r--r-- | pugl/pugl_win.c | 11 |
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 |