From df98427825234b24cfa87ad9f9d8a0d738b3ea13 Mon Sep 17 00:00:00 2001 From: hachem Date: Sat, 16 Aug 2025 22:00:16 +0200 Subject: [add]: preferences and saving --- src/Core/Application.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/Core/Application.cpp') 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(); } -- cgit v1.3