From 908ef3765cb33a1bac8ac6665326bfd9817f2d73 Mon Sep 17 00:00:00 2001 From: saschawillems Date: Tue, 3 May 2016 21:22:45 +0200 Subject: [PATCH] Assign destWidth and destHeight before starting render loop to avoid unnecessary resize on windows, store last fps count --- base/vulkanexamplebase.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index 90f7996e..58ce8a5f 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -357,6 +357,8 @@ void VulkanExampleBase::loadMesh( void VulkanExampleBase::renderLoop() { + destWidth = width; + destHeight = height; #if defined(_WIN32) MSG msg; while (TRUE) @@ -393,6 +395,7 @@ void VulkanExampleBase::renderLoop() { std::string windowTitle = getWindowTitle(); SetWindowText(window, windowTitle.c_str()); + lastFPS = frameCounter; fpsTimer = 0.0f; frameCounter = 0.0f; } @@ -450,6 +453,7 @@ void VulkanExampleBase::renderLoop() if (fpsTimer > 1000.0f) { LOGD("%d fps", frameCounter); + lastFPS = frameCounter; fpsTimer = 0.0f; frameCounter = 0.0f; } @@ -516,6 +520,7 @@ void VulkanExampleBase::renderLoop() xcb_change_property(connection, XCB_PROP_MODE_REPLACE, window, XCB_ATOM_WM_NAME, XCB_ATOM_STRING, 8, windowTitle.size(), windowTitle.c_str()); + lastFPS = frameCounter; fpsTimer = 0.0f; frameCounter = 0.0f; } @@ -1491,7 +1496,7 @@ void VulkanExampleBase::windowResize() void VulkanExampleBase::windowResized() { - // Can be overrdiden in derived class + // Can be overriden in derived class } void VulkanExampleBase::initSwapchain()