diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index a64a1905..f19bdeb5 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -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; } } diff --git a/base/vulkanexamplebase.h b/base/vulkanexamplebase.h index fea1ded6..c31468bc 100644 --- a/base/vulkanexamplebase.h +++ b/base/vulkanexamplebase.h @@ -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: