aboutsummaryrefslogtreecommitdiff
path: root/src/Core
diff options
context:
space:
mode:
Diffstat (limited to 'src/Core')
-rw-r--r--src/Core/Application.cpp21
-rw-r--r--src/Core/SettingsManager.cpp2
2 files changed, 17 insertions, 6 deletions
diff --git a/src/Core/Application.cpp b/src/Core/Application.cpp
index b879535..62f1faa 100644
--- a/src/Core/Application.cpp
+++ b/src/Core/Application.cpp
@@ -5,9 +5,10 @@
#include "States/SimulationState.h"
#include "States/ConfigState.h"
+#include "States/WorldBuilderState.h"
#include <GLFW/glfw3.h>
-
+#include <ImGuizmo.h>
namespace Donut
{
@@ -88,6 +89,12 @@ namespace Donut
event.Handled = true;
return true;
}
+ else if (e.GetKeyCode() == GLFW_KEY_3)
+ {
+ m_StateManager->SwitchToState("WorldBuilder");
+ event.Handled = true;
+ return true;
+ }
return true;
});
@@ -99,10 +106,8 @@ namespace Donut
{
Logger::Init();
- // 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);
@@ -114,8 +119,9 @@ namespace Donut
RenderCommand::SetFaceCulling(false);
m_StateManager = CreateScope<StateManager>();
- m_StateManager->RegisterState("Config", CreateScope<ConfigState>());
- m_StateManager->RegisterState("Simulation", CreateScope<SimulationState>());
+ m_StateManager->RegisterState("Config", CreateScope<ConfigState>());
+ m_StateManager->RegisterState("Simulation", CreateScope<SimulationState>());
+ m_StateManager->RegisterState("WorldBuilder", CreateScope<WorldBuilderState>());
m_StateManager->SwitchToState("Config");
}
@@ -141,8 +147,11 @@ namespace Donut
void Application::OnRender()
{
m_StateManager->Render();
-
m_Window->BeginImGuiFrame();
+
+ ImGuizmo::BeginFrame();
+ ImGuizmo::SetOrthographic(false);
+
SetupDockingLayout();
m_StateManager->OnImUIRender();
m_Window->EndImGuiFrame();
diff --git a/src/Core/SettingsManager.cpp b/src/Core/SettingsManager.cpp
index eed2a3f..af163e7 100644
--- a/src/Core/SettingsManager.cpp
+++ b/src/Core/SettingsManager.cpp
@@ -138,7 +138,9 @@ namespace Donut
DONUT_INFO("Settings saved to {}", filePath);
}
catch (const std::exception& e)
+ {
DONUT_ERROR("Failed to save settings: {}", e.what());
+ }
}
void SettingsManager::SetSimulationSettings(const SimulationSettings& settings)