diff --git a/base/VulkanUIOverlay.cpp b/base/VulkanUIOverlay.cpp index 190e9481..cc705864 100644 --- a/base/VulkanUIOverlay.cpp +++ b/base/VulkanUIOverlay.cpp @@ -540,12 +540,13 @@ namespace vks } } - void UIOverlay::resize(uint32_t width, uint32_t height) + void UIOverlay::resize(uint32_t width, uint32_t height, std::vector framebuffers) { ImGuiIO& io = ImGui::GetIO(); io.DisplaySize = ImVec2((float)(width), (float)(height)); createInfo.width = width; createInfo.height = height; + createInfo.framebuffers = framebuffers; updateCommandBuffers(); } diff --git a/base/VulkanUIOverlay.h b/base/VulkanUIOverlay.h index f545fba4..1552eb8c 100644 --- a/base/VulkanUIOverlay.h +++ b/base/VulkanUIOverlay.h @@ -91,7 +91,7 @@ namespace vks ~UIOverlay(); void update(); - void resize(uint32_t width, uint32_t height); + void resize(uint32_t width, uint32_t height, std::vector framebuffers); void submit(VkQueue queue, uint32_t bufferindex, VkSubmitInfo submitInfo); diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index 95382116..15b22a21 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -573,7 +573,7 @@ void VulkanExampleBase::updateOverlay() ImGui::Begin("Vulkan Example", nullptr, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove); ImGui::TextUnformatted(title.c_str()); ImGui::TextUnformatted(deviceProperties.deviceName); - ImGui::Text("%.2f ms/frame (%.1d fps)", (frameTimer * 1000.0f), lastFPS); + ImGui::Text("%.2f ms/frame (%.1d fps)", (1000.0f / lastFPS), lastFPS); #if defined(VK_USE_PLATFORM_ANDROID_KHR) ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0.0f, 5.0f * UIOverlay->scale)); @@ -2078,7 +2078,7 @@ void VulkanExampleBase::windowResize() vkDeviceWaitIdle(device); if (settings.overlay) { - UIOverlay->resize(width, height); + UIOverlay->resize(width, height, frameBuffers); } camera.updateAspectRatio((float)width / (float)height);