aboutsummaryrefslogtreecommitdiff
path: root/src/Core/Application.h
diff options
context:
space:
mode:
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