diff --git a/RenderSystems/Vulkan/include/Windowing/win32/OgreVulkanWin32Window.h b/RenderSystems/Vulkan/include/Windowing/win32/OgreVulkanWin32Window.h index 779ab8eadb..eee99e766d 100644 --- a/RenderSystems/Vulkan/include/Windowing/win32/OgreVulkanWin32Window.h +++ b/RenderSystems/Vulkan/include/Windowing/win32/OgreVulkanWin32Window.h @@ -51,7 +51,7 @@ namespace Ogre static bool mClassRegistered; - void updateWindowRect(); + bool updateWindowRect(); void adjustWindow( uint32 clientWidth, uint32 clientHeight, // uint32 *outDrawableWidth, uint32 *outDrawableHeight ); diff --git a/RenderSystems/Vulkan/src/Windowing/win32/OgreVulkanWin32Window.cpp b/RenderSystems/Vulkan/src/Windowing/win32/OgreVulkanWin32Window.cpp index 0c330dd161..045515bded 100644 --- a/RenderSystems/Vulkan/src/Windowing/win32/OgreVulkanWin32Window.cpp +++ b/RenderSystems/Vulkan/src/Windowing/win32/OgreVulkanWin32Window.cpp @@ -98,8 +98,9 @@ namespace Ogre return VK_KHR_WIN32_SURFACE_EXTENSION_NAME; } //------------------------------------------------------------------------- - void VulkanWin32Window::updateWindowRect() + bool VulkanWin32Window::updateWindowRect() { + bool bResolutionChanged = false; RECT rc; BOOL result; result = GetWindowRect( mHwnd, &rc ); @@ -108,7 +109,7 @@ namespace Ogre mTop = 0; mLeft = 0; setFinalResolution( 0, 0 ); - return; + return bResolutionChanged; } mTop = rc.top; @@ -119,16 +120,19 @@ namespace Ogre mTop = 0; mLeft = 0; setFinalResolution( 0, 0 ); - return; + return bResolutionChanged; } uint32 width = static_cast( rc.right - rc.left ); uint32 height = static_cast( rc.bottom - rc.top ); if( width != getWidth() || height != getHeight() ) { + bResolutionChanged = true; mRequestedWidth = static_cast( rc.right - rc.left ); mRequestedHeight = static_cast( rc.bottom - rc.top ); setFinalResolution( mRequestedWidth, mRequestedHeight ); } + + return bResolutionChanged; } //------------------------------------------------------------------------- void VulkanWin32Window::destroy() @@ -712,9 +716,9 @@ namespace Ogre if( !mHwnd || IsIconic( mHwnd ) ) return; - updateWindowRect(); + const bool bResolutionChanged = updateWindowRect(); - if( mRequestedWidth == getWidth() && mRequestedHeight == getHeight() && !mRebuildingSwapchain ) + if( !bResolutionChanged && !mRebuildingSwapchain ) return; mDevice->stall();