diff options
| author | hachem <im@hachem.wtf> | 2025-08-12 16:35:42 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2025-08-12 16:35:42 +0200 |
| commit | dbe642e5e26cf2bd99218f727157b58c7fed286e (patch) | |
| tree | b964424747bdd0b143a4dfac894aee61fd752302 /src/core/application.h | |
| parent | d6b9f6c8fad3e46caca5dc167ce1cbf5ccfb489e (diff) | |
feat: application manager and EventDispatcher
Diffstat (limited to 'src/core/application.h')
| -rw-r--r-- | src/core/application.h | 35 |
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; + }; +} |
