Updated window resize handling on (Fixes #171)
This commit is contained in:
parent
85945cfb1a
commit
422ac626e5
2 changed files with 8 additions and 7 deletions
|
|
@ -1090,20 +1090,20 @@ void VulkanExampleBase::handleMessages(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
|
||||||
break;
|
break;
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
if ((prepared) && (wParam != SIZE_MINIMIZED))
|
if ((prepared) && (wParam != SIZE_MINIMIZED))
|
||||||
|
{
|
||||||
|
if ((resizing) || ((wParam == SIZE_MAXIMIZED) || (wParam == SIZE_RESTORED)))
|
||||||
{
|
{
|
||||||
destWidth = LOWORD(lParam);
|
destWidth = LOWORD(lParam);
|
||||||
destHeight = HIWORD(lParam);
|
destHeight = HIWORD(lParam);
|
||||||
if ((wParam == SIZE_MAXIMIZED) || (wParam == SIZE_MINIMIZED))
|
|
||||||
{
|
|
||||||
windowResize();
|
windowResize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case WM_ENTERSIZEMOVE:
|
||||||
|
resizing = true;
|
||||||
|
break;
|
||||||
case WM_EXITSIZEMOVE:
|
case WM_EXITSIZEMOVE:
|
||||||
if ((prepared) && ((destWidth != width) || (destHeight != height)))
|
resizing = false;
|
||||||
{
|
|
||||||
windowResize();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ private:
|
||||||
// Destination dimensions for resizing the window
|
// Destination dimensions for resizing the window
|
||||||
uint32_t destWidth;
|
uint32_t destWidth;
|
||||||
uint32_t destHeight;
|
uint32_t destHeight;
|
||||||
|
bool resizing = false;
|
||||||
// Called if the window is resized and some resources have to be recreatesd
|
// Called if the window is resized and some resources have to be recreatesd
|
||||||
void windowResize();
|
void windowResize();
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue