diff options
Diffstat (limited to 'src/gallium/state_trackers/wgl/stw_st.c')
-rw-r--r-- | src/gallium/state_trackers/wgl/stw_st.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/wgl/stw_st.c b/src/gallium/state_trackers/wgl/stw_st.c index 28c93f4..7151508 100644 --- a/src/gallium/state_trackers/wgl/stw_st.c +++ b/src/gallium/state_trackers/wgl/stw_st.c @@ -175,10 +175,21 @@ stw_st_framebuffer_flush_front(struct st_framebuffer_iface *stfb, enum st_attachment_type statt) { struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb); + boolean ret; + HDC hDC; pipe_mutex_lock(stwfb->fb->mutex); - return stw_st_framebuffer_present_locked(stwfb->fb->hDC, &stwfb->base, statt); + /* We must not cache HDCs anywhere, as they can be invalidated by the + * application, or screen resolution changes. */ + + hDC = GetDC(stwfb->fb->hWnd); + + ret = stw_st_framebuffer_present_locked(hDC, &stwfb->base, statt); + + ReleaseDC(stwfb->fb->hWnd, hDC); + + return ret; } /** |