aboutsummaryrefslogtreecommitdiff
path: root/src/Core/Application.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-08-12 16:35:42 +0200
committerhachem <im@hachem.wtf>2025-08-12 16:35:42 +0200
commit16dff443789c7f1461b46ce52966972ae14c042b (patch)
treeafbaf901703c05cbb5eb18f3333898eb498d2e54 /src/Core/Application.h
parented6de8793f267fb1fc5c9af2e68cd4e573ee1d25 (diff)
[add]: Application manager and EventDispatcher
Diffstat (limited to 'src/Core/Application.h')
-rw-r--r--src/Core/Application.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Core/Application.h b/src/Core/Application.h
new file mode 100644
index 0000000..fca4c42
--- /dev/null
+++ b/src/Core/Application.h
@@ -0,0 +1,35 @@
+#pragma once
+
+#include "Window.h"
+#include "Event.h"
+#include <memory>
+#include <functional>
+
+namespace Donut
+{
+ class Application
+ {
+ public:
+ Application(const std::string& name = "Donut",
+ int width = 1280, int height = 720);
+ ~Application();
+
+ void Run();
+ void Close();
+
+ Window& GetWindow() { return *m_Window; }
+ static Application& Get() { return *s_Instance; }
+ private:
+ void OnInit();
+ void OnShutdown();
+ void OnUpdate();
+ void OnRender();
+ void OnEvent(Event& event);
+ private:
+ std::unique_ptr<Window> m_Window;
+ bool m_Running;
+ bool m_Minimized;
+
+ static Application* s_Instance;
+ };
+} \ No newline at end of file