Updated window resize handling on (Fixes #171)

This commit is contained in:
saschawillems 2016-10-16 17:39:30 +02:00
parent 85945cfb1a
commit 422ac626e5
2 changed files with 8 additions and 7 deletions

View file

@ -1091,19 +1091,19 @@ void VulkanExampleBase::handleMessages(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
case WM_SIZE:
if ((prepared) && (wParam != SIZE_MINIMIZED))
{
destWidth = LOWORD(lParam);
destHeight = HIWORD(lParam);
if ((wParam == SIZE_MAXIMIZED) || (wParam == SIZE_MINIMIZED))
if ((resizing) || ((wParam == SIZE_MAXIMIZED) || (wParam == SIZE_RESTORED)))
{
destWidth = LOWORD(lParam);
destHeight = HIWORD(lParam);
windowResize();
}
}
break;
case WM_ENTERSIZEMOVE:
resizing = true;
break;
case WM_EXITSIZEMOVE:
if ((prepared) && ((destWidth != width) || (destHeight != height)))
{
windowResize();
}
resizing = false;
break;
}
}

View file

@ -68,6 +68,7 @@ private:
// Destination dimensions for resizing the window
uint32_t destWidth;
uint32_t destHeight;
bool resizing = false;
// Called if the window is resized and some resources have to be recreatesd
void windowResize();
protected: