diff options
| author | hachem <im@hachem.wtf> | 2025-08-16 22:00:16 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2025-08-16 22:00:16 +0200 |
| commit | df98427825234b24cfa87ad9f9d8a0d738b3ea13 (patch) | |
| tree | e9c2f7387e476c84e7de043404d771e0c3eacf63 /src/Core/Application.cpp | |
| parent | 279e2378c1ef02e3917c29f8fafb39c058971577 (diff) | |
[add]: preferences and saving
Diffstat (limited to 'src/Core/Application.cpp')
| -rw-r--r-- | src/Core/Application.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Core/Application.cpp b/src/Core/Application.cpp index 302132a..b879535 100644 --- a/src/Core/Application.cpp +++ b/src/Core/Application.cpp @@ -1,6 +1,7 @@ #include "Application.h" #include "Rendering/Renderer.h" +#include "SettingsManager.h" #include "States/SimulationState.h" #include "States/ConfigState.h" @@ -98,7 +99,14 @@ namespace Donut { Logger::Init(); - RendererAPI::SetAPI(RendererAPI::API::OpenGL); + // Initialize settings manager first + SettingsManager::Initialize(); + + // Apply loaded settings + const auto& settings = SettingsManager::GetSettingsConst(); + RendererAPI::API api = (settings.graphics.renderAPI == "Vulkan") ? RendererAPI::API::Vulkan : RendererAPI::API::OpenGL; + RendererAPI::SetAPI(api); + Renderer::Init(); m_Window->InitImGui(); @@ -117,6 +125,7 @@ namespace Donut m_StateManager->Shutdown(); Renderer::Shutdown(); + SettingsManager::Shutdown(); Logger::Shutdown(); } |
