Add second init and close stage for GraphicsApp
This commit is contained in:
@@ -24,6 +24,8 @@ namespace OpenVulkano
|
|||||||
~IGraphicsApp() override = default;
|
~IGraphicsApp() override = default;
|
||||||
|
|
||||||
virtual void Init() = 0;
|
virtual void Init() = 0;
|
||||||
|
virtual void InitPostGraphics() {}
|
||||||
|
virtual void CloseFinalize() {}
|
||||||
[[nodiscard]] IGraphicsAppManager* GetGraphicsAppManager() const { return m_manager; }
|
[[nodiscard]] IGraphicsAppManager* GetGraphicsAppManager() const { return m_manager; }
|
||||||
void SetGraphicsAppManager(IGraphicsAppManager* manager) { m_manager = manager; }
|
void SetGraphicsAppManager(IGraphicsAppManager* manager) { m_manager = manager; }
|
||||||
[[nodiscard]] virtual std::string GetAppName() const = 0;
|
[[nodiscard]] virtual std::string GetAppName() const = 0;
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ namespace OpenVulkano
|
|||||||
//TODO restore window settings if there are any set
|
//TODO restore window settings if there are any set
|
||||||
renderer->Init(static_cast<IGraphicsAppManager*>(this), window);
|
renderer->Init(static_cast<IGraphicsAppManager*>(this), window);
|
||||||
windowTitleFormat = app->GetAppName() + " " + static_cast<std::string>(app->GetAppVersion()) + " - " + renderer->GetMainRenderDeviceName() + " - {:.1f} fps ({:.1f} ms)";
|
windowTitleFormat = app->GetAppName() + " " + static_cast<std::string>(app->GetAppVersion()) + " - " + renderer->GetMainRenderDeviceName() + " - {:.1f} fps ({:.1f} ms)";
|
||||||
|
app->InitPostGraphics();
|
||||||
Logger::MANAGER->info("Initialized");
|
Logger::MANAGER->info("Initialized");
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
@@ -144,6 +145,7 @@ namespace OpenVulkano
|
|||||||
window->Close();
|
window->Close();
|
||||||
if (platform) platform->Close();
|
if (platform) platform->Close();
|
||||||
windowTitleFormat = "";
|
windowTitleFormat = "";
|
||||||
|
app->CloseFinalize();
|
||||||
Logger::MANAGER->info("Shutdown complete");
|
Logger::MANAGER->info("Shutdown complete");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user