aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Core/Game.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Core/Game.h')
-rw-r--r--src/libjin/Core/Game.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/libjin/Core/Game.h b/src/libjin/Core/Game.h
new file mode 100644
index 0000000..e155607
--- /dev/null
+++ b/src/libjin/Core/Game.h
@@ -0,0 +1,59 @@
+#ifndef __JIN_CORE_GAME_H
+#define __JIN_CORE_GAME_H
+
+#include <SDL2/SDL.h>
+
+#include "../common/singleton.h"
+#include "../utils/macros.h"
+
+namespace jin
+{
+namespace core
+{
+ class Game : public Singleton<Game>
+ {
+ public:
+
+ struct Setting
+ {
+
+ };
+
+ inline void quit() // quit game loop
+ {
+ CALLONCE(_quit());
+ }
+
+ inline bool running()
+ {
+ return run;
+ }
+
+ inline void exit() // exit game
+ {
+ CALLONCE(_exit());
+ }
+
+ private:
+
+ Game();
+ ~Game() {};
+
+ SINGLETON(Game);
+
+ bool run;
+
+ inline void _exit()
+ {
+ SDL_Quit();
+ }
+
+ inline void _quit()
+ {
+ run = false;
+ }
+ };
+}
+}
+
+#endif \ No newline at end of file