Fix issues with UI renderer
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user