Fix issues with de/re-initialisation

This commit is contained in:
2023-09-18 15:13:14 +02:00
parent de75b6c724
commit 090e75a1ca
5 changed files with 7 additions and 3 deletions

View File

@@ -30,6 +30,7 @@ namespace openVulkanoCpp::AR::Playback
colorImage.intrinsic = frameMetadata.intrinsic.GetForResolution({ colorImgData.cols, colorImgData.rows });
colorImage.format = ArImagePlanar::Format::RGB;
colorImage.luminescenceOrColor = { colorImgData.data, { colorImgData.cols, colorImgData.rows }};
SetSaved();
}
ArImagePlanar ArFramePlayback::GetCameraImage()

View File

@@ -142,7 +142,7 @@ namespace openVulkanoCpp
renderer->Close();
window->Close();
app->Close();
platform->Close();
if (platform) platform->Close();
windowTitleFormat = "";
Logger::MANAGER->info("Shutdown complete");
}

View File

@@ -60,8 +60,10 @@ namespace openVulkanoCpp
{
ImGuiIO& io = ImGui::GetIO();
#ifndef __APPLE__
ImGui::DestroyPlatformWindows();
#endif
io.BackendPlatformName = nullptr;
io.BackendPlatformUserData = nullptr;
io.BackendFlags = ImGuiBackendFlags_None;

View File

@@ -35,7 +35,7 @@ namespace openVulkanoCpp::Scene
void Drawable::RemoveNode(Node* node)
{
Utils::Remove(m_nodes, node);
if (m_nodes.empty())
if (m_nodes.empty() && m_scene)
{
m_scene->RemoveDrawable(this);
m_scene = nullptr;

View File

@@ -84,6 +84,7 @@ namespace openVulkanoCpp::Vulkan
void Renderer::Resize(const uint32_t newWidth, const uint32_t newHeight)
{
if (!context.device) return;
context.Resize(newWidth, newHeight);
resourceManager.Resize();
}