Fixing the assert when window is minimized. For you Rick :)

This commit is contained in:
Ben Vanik 2015-05-21 19:23:44 -07:00
parent bac3f8c3bd
commit 37f1953466
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -107,10 +107,12 @@ LRESULT WGLControl::WndProc(HWND hWnd, UINT message, WPARAM wParam,
void WGLControl::SynchronousRepaint(std::function<void()> 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);
}