Fix issues with UI renderer

This commit is contained in:
2023-09-06 00:03:06 +02:00
parent f9688792c4
commit 9709861bda
5 changed files with 29 additions and 9 deletions

View File

@@ -62,10 +62,14 @@ namespace openVulkanoCpp::Vulkan
#ifdef GLFW_AVAILABLE
ImGui_ImplGlfw_InitForVulkan((GLFWwindow*)context->window->GetNativeWindowHandle(), true);
#endif
uiInitialized = true;
if (ui) ui->Init();
}
void UiRenderer::Close()
{
uiInitialized = false;
ImGui_ImplVulkan_Shutdown();
device.destroy(descriptorPool);
}
@@ -91,4 +95,10 @@ namespace openVulkanoCpp::Vulkan
ImGui_ImplVulkan_RenderDrawData(ImGui::GetDrawData(), cmdBuffer);
uiRenderPass.End(cmdBuffer);
}
void UiRenderer::SetActiveUi(Scene::UI::Ui* ui)
{
this->ui = ui;
if (ui && uiInitialized) ui->Init();
}
}