diff options
author | chai <chaifix@163.com> | 2018-07-27 00:01:34 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-07-27 00:01:34 +0800 |
commit | b855ebb91ad8d97617ec1aa418b4add84670a07d (patch) | |
tree | b11847a1879a2582c9cfd380074ad4c70f17a1a8 /src/libjin/Core/Game.h | |
parent | 1a882936e91826e4d69584745e16a79650272015 (diff) |
*change name
Diffstat (limited to 'src/libjin/Core/Game.h')
-rw-r--r-- | src/libjin/Core/Game.h | 59 |
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 |