hachem.wtf
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..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;
+ };
+}