From b855ebb91ad8d97617ec1aa418b4add84670a07d Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 27 Jul 2018 00:01:34 +0800 Subject: *change name --- src/libjin/Core/Game.h | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/libjin/Core/Game.h (limited to 'src/libjin/Core/Game.h') 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 + +#include "../common/singleton.h" +#include "../utils/macros.h" + +namespace jin +{ +namespace core +{ + class Game : public Singleton + { + 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 -- cgit v1.1-26-g67d0