hachem.wtf
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
commitdbe642e5e26cf2bd99218f727157b58c7fed286e (patch)
treeb964424747bdd0b143a4dfac894aee61fd752302 /src/core/application.h
parentd6b9f6c8fad3e46caca5dc167ce1cbf5ccfb489e (diff)
feat: 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..d88eab2
--- /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& get_window() { return *m_window; }
+ static Application& get() { return *s_instance; }
+ private:
+ void on_init();
+ void on_shutdown();
+ void on_update();
+ void on_render();
+ void on_event(Event& event);
+ private:
+ std::unique_ptr<Window> m_window;
+ bool m_running;
+ bool m_minimized;
+
+ static Application* s_instance;
+ };
+}