From 16dff443789c7f1461b46ce52966972ae14c042b Mon Sep 17 00:00:00 2001 From: hachem Date: Tue, 12 Aug 2025 16:35:42 +0200 Subject: [add]: Application manager and EventDispatcher --- src/Core/Application.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/Core/Application.h (limited to 'src/Core/Application.h') 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 +#include + +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 m_Window; + bool m_Running; + bool m_Minimized; + + static Application* s_Instance; + }; +} \ No newline at end of file -- cgit v1.3