From 37f19534660b24a15f6813a433d3927938959997 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Thu, 21 May 2015 19:23:44 -0700 Subject: [PATCH] Fixing the assert when window is minimized. For you Rick :) --- src/xenia/gpu/gl4/gl4_graphics_system.cc | 2 +- src/xenia/gpu/gl4/wgl_control.cc | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xenia/gpu/gl4/gl4_graphics_system.cc b/src/xenia/gpu/gl4/gl4_graphics_system.cc index f29d186d8..5838bc7df 100644 --- a/src/xenia/gpu/gl4/gl4_graphics_system.cc +++ b/src/xenia/gpu/gl4/gl4_graphics_system.cc @@ -262,7 +262,7 @@ void GL4GraphicsSystem::SwapHandler(const SwapParameters& swap_params) { // Swap requested. Synchronously post a request to the loop so that // we do the swap in the right thread. - control_->SynchronousRepaint([&]() { + control_->SynchronousRepaint([this, swap_params]() { if (!swap_params.framebuffer_texture) { // no-op. return; diff --git a/src/xenia/gpu/gl4/wgl_control.cc b/src/xenia/gpu/gl4/wgl_control.cc index bd708597f..25a6ced0e 100644 --- a/src/xenia/gpu/gl4/wgl_control.cc +++ b/src/xenia/gpu/gl4/wgl_control.cc @@ -107,10 +107,12 @@ LRESULT WGLControl::WndProc(HWND hWnd, UINT message, WPARAM wParam, void WGLControl::SynchronousRepaint(std::function paint_callback) { SCOPE_profile_cpu_f("gpu"); - assert_null(current_paint_callback_); + // We may already have a pending paint from a previous request when we + // were minimized. We just overwrite it. current_paint_callback_ = std::move(paint_callback); // This will not return until the WM_PAINT has completed. + // Note, if we are minimized this won't do anything. RedrawWindow(hwnd(), nullptr, nullptr, RDW_INTERNALPAINT | RDW_UPDATENOW | RDW_ALLCHILDREN); }