diff options
Diffstat (limited to 'libjin/Core/Game.h')
-rw-r--r-- | libjin/Core/Game.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/libjin/Core/Game.h b/libjin/Core/Game.h new file mode 100644 index 0000000..e155607 --- /dev/null +++ b/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 |