From 1f42dbda61202e32d257b0c10d44800e6b2f933e Mon Sep 17 00:00:00 2001 From: saschawillems Date: Sat, 30 Jun 2018 21:56:23 +0200 Subject: [PATCH] No longer render if window is minimized (Windows) Refs #493 --- base/vulkanexamplebase.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index 0a66e133..4e9a627e 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -304,7 +304,9 @@ void VulkanExampleBase::renderLoop() break; } } - renderFrame(); + if (!IsIconic(window)) { + renderFrame(); + } } #elif defined(VK_USE_PLATFORM_ANDROID_KHR) while (1) @@ -2172,12 +2174,13 @@ void VulkanExampleBase::windowResize() vkDeviceWaitIdle(device); - if (settings.overlay) { - UIOverlay->resize(width, height, frameBuffers); + if ((width > 0.0f) && (height > 0.0f)) { + if (settings.overlay) { + UIOverlay->resize(width, height, frameBuffers); + } + camera.updateAspectRatio((float)width / (float)height); } - camera.updateAspectRatio((float)width / (float)height); - // Notify derived class windowResized(); viewChanged();