Add second init and close stage for GraphicsApp

This commit is contained in:
2023-10-08 21:13:42 +02:00
parent ff684504ad
commit 811ebf347a
2 changed files with 4 additions and 0 deletions

View File

@@ -24,6 +24,8 @@ namespace OpenVulkano
~IGraphicsApp() override = default;
virtual void Init() = 0;
virtual void InitPostGraphics() {}
virtual void CloseFinalize() {}
[[nodiscard]] IGraphicsAppManager* GetGraphicsAppManager() const { return m_manager; }
void SetGraphicsAppManager(IGraphicsAppManager* manager) { m_manager = manager; }
[[nodiscard]] virtual std::string GetAppName() const = 0;

View File

@@ -97,6 +97,7 @@ namespace OpenVulkano
//TODO restore window settings if there are any set
renderer->Init(static_cast<IGraphicsAppManager*>(this), window);
windowTitleFormat = app->GetAppName() + " " + static_cast<std::string>(app->GetAppVersion()) + " - " + renderer->GetMainRenderDeviceName() + " - {:.1f} fps ({:.1f} ms)";
app->InitPostGraphics();
Logger::MANAGER->info("Initialized");
}
catch (std::exception& e)
@@ -144,6 +145,7 @@ namespace OpenVulkano
window->Close();
if (platform) platform->Close();
windowTitleFormat = "";
app->CloseFinalize();
Logger::MANAGER->info("Shutdown complete");
}