Pass updated frame buffers on resize
This commit is contained in:
parent
a8cb646a7c
commit
b7d2dbced4
3 changed files with 5 additions and 4 deletions
|
|
@ -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<VkFramebuffer> framebuffers)
|
||||||
{
|
{
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
io.DisplaySize = ImVec2((float)(width), (float)(height));
|
io.DisplaySize = ImVec2((float)(width), (float)(height));
|
||||||
createInfo.width = width;
|
createInfo.width = width;
|
||||||
createInfo.height = height;
|
createInfo.height = height;
|
||||||
|
createInfo.framebuffers = framebuffers;
|
||||||
updateCommandBuffers();
|
updateCommandBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ namespace vks
|
||||||
~UIOverlay();
|
~UIOverlay();
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
void resize(uint32_t width, uint32_t height);
|
void resize(uint32_t width, uint32_t height, std::vector<VkFramebuffer> framebuffers);
|
||||||
|
|
||||||
void submit(VkQueue queue, uint32_t bufferindex, VkSubmitInfo submitInfo);
|
void submit(VkQueue queue, uint32_t bufferindex, VkSubmitInfo submitInfo);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -573,7 +573,7 @@ void VulkanExampleBase::updateOverlay()
|
||||||
ImGui::Begin("Vulkan Example", nullptr, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove);
|
ImGui::Begin("Vulkan Example", nullptr, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove);
|
||||||
ImGui::TextUnformatted(title.c_str());
|
ImGui::TextUnformatted(title.c_str());
|
||||||
ImGui::TextUnformatted(deviceProperties.deviceName);
|
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)
|
#if defined(VK_USE_PLATFORM_ANDROID_KHR)
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0.0f, 5.0f * UIOverlay->scale));
|
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0.0f, 5.0f * UIOverlay->scale));
|
||||||
|
|
@ -2078,7 +2078,7 @@ void VulkanExampleBase::windowResize()
|
||||||
vkDeviceWaitIdle(device);
|
vkDeviceWaitIdle(device);
|
||||||
|
|
||||||
if (settings.overlay) {
|
if (settings.overlay) {
|
||||||
UIOverlay->resize(width, height);
|
UIOverlay->resize(width, height, frameBuffers);
|
||||||
}
|
}
|
||||||
|
|
||||||
camera.updateAspectRatio((float)width / (float)height);
|
camera.updateAspectRatio((float)width / (float)height);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue