aboutsummaryrefslogtreecommitdiff
path: root/src/Core/Application.cpp
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-08-14 01:24:24 +0200
committerhachem <im@hachem.wtf>2025-08-14 01:24:24 +0200
commit613f99e937e55f73dcec1251fdce4a9fda077a0f (patch)
treeb86ed54045783b47a0f856476a6465d3777b7005 /src/Core/Application.cpp
parente050dce79b67ae6386240567a994454711ab998d (diff)
[add]: implement an ImGUI layer
Diffstat (limited to 'src/Core/Application.cpp')
-rw-r--r--src/Core/Application.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Core/Application.cpp b/src/Core/Application.cpp
index a886327..9aac646 100644
--- a/src/Core/Application.cpp
+++ b/src/Core/Application.cpp
@@ -2,8 +2,8 @@
#include "Rendering/Renderer.h"
-#include "States/ConfigState.h"
#include "States/SimulationState.h"
+#include "States/ConfigState.h"
#include <GLFW/glfw3.h>
@@ -86,12 +86,6 @@ namespace Donut
event.Handled = true;
return true;
}
- else if (e.GetKeyCode() == GLFW_KEY_3)
- {
- m_StateManager->SwitchToState("Menu");
- event.Handled = true;
- return true;
- }
return true;
});
@@ -105,12 +99,13 @@ namespace Donut
RendererAPI::SetAPI(RendererAPI::API::OpenGL);
Renderer::Init();
+ m_Window->InitImGui();
Renderer::OnWindowResize(1280, 720);
RenderCommand::SetFaceCulling(false);
m_StateManager = CreateScope<StateManager>();
- m_StateManager->RegisterState("Config", CreateScope<ConfigState>());
+ m_StateManager->RegisterState("Config", CreateScope<ConfigState>());
m_StateManager->RegisterState("Simulation", CreateScope<SimulationState>());
m_StateManager->SwitchToState("Config");
}
@@ -136,5 +131,9 @@ namespace Donut
void Application::OnRender()
{
m_StateManager->Render();
+
+ m_Window->BeginImGuiFrame();
+ m_StateManager->OnImUIRender();
+ m_Window->EndImGuiFrame();
}
};