aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/win.c6
-rw-r--r--src/win.h1
-rw-r--r--src/win_cairo.c6
-rw-r--r--src/win_gl.c6
4 files changed, 7 insertions, 12 deletions
diff --git a/src/win.c b/src/win.c
index 08eebec..75e0d71 100644
--- a/src/win.c
+++ b/src/win.c
@@ -1651,8 +1651,7 @@ PuglStatus
puglWinEnter(PuglView* view, const PuglExposeEvent* expose)
{
if (expose) {
- PAINTSTRUCT ps;
- BeginPaint(view->impl->hwnd, &ps);
+ BeginPaint(view->impl->hwnd, &view->impl->paint);
}
return PUGL_SUCCESS;
@@ -1662,8 +1661,7 @@ PuglStatus
puglWinLeave(PuglView* view, const PuglExposeEvent* expose)
{
if (expose) {
- PAINTSTRUCT ps;
- EndPaint(view->impl->hwnd, &ps);
+ EndPaint(view->impl->hwnd, &view->impl->paint);
}
return PUGL_SUCCESS;
diff --git a/src/win.h b/src/win.h
index 890d940..84f1d4e 100644
--- a/src/win.h
+++ b/src/win.h
@@ -25,6 +25,7 @@ struct PuglInternalsImpl {
HCURSOR cursor;
HDC hdc;
WINDOWPLACEMENT oldPlacement;
+ PAINTSTRUCT paint;
PuglBlob clipboard;
PuglSurface* surface;
double scaleFactor;
diff --git a/src/win_cairo.c b/src/win_cairo.c
index 4bef2e6..10e06e6 100644
--- a/src/win_cairo.c
+++ b/src/win_cairo.c
@@ -108,8 +108,7 @@ puglWinCairoEnter(PuglView* view, const PuglExposeEvent* expose)
if (expose && !(st = puglWinCairoCreateDrawContext(view)) &&
!(st = puglWinCairoOpen(view))) {
- PAINTSTRUCT ps;
- BeginPaint(view->impl->hwnd, &ps);
+ BeginPaint(view->impl->hwnd, &view->impl->paint);
}
return st;
@@ -136,8 +135,7 @@ puglWinCairoLeave(PuglView* view, const PuglExposeEvent* expose)
puglWinCairoClose(view);
puglWinCairoDestroyDrawContext(view);
- PAINTSTRUCT ps;
- EndPaint(view->impl->hwnd, &ps);
+ EndPaint(view->impl->hwnd, &view->impl->paint);
}
return PUGL_SUCCESS;
diff --git a/src/win_gl.c b/src/win_gl.c
index 0ca9909..293dd9b 100644
--- a/src/win_gl.c
+++ b/src/win_gl.c
@@ -264,8 +264,7 @@ puglWinGlEnter(PuglView* view, const PuglExposeEvent* expose)
wglMakeCurrent(view->impl->hdc, surface->hglrc);
if (expose) {
- PAINTSTRUCT ps;
- BeginPaint(view->impl->hwnd, &ps);
+ BeginPaint(view->impl->hwnd, &view->impl->paint);
}
return PUGL_SUCCESS;
@@ -275,8 +274,7 @@ static PuglStatus
puglWinGlLeave(PuglView* view, const PuglExposeEvent* expose)
{
if (expose) {
- PAINTSTRUCT ps;
- EndPaint(view->impl->hwnd, &ps);
+ EndPaint(view->impl->hwnd, &view->impl->paint);
SwapBuffers(view->impl->hdc);
}