diff options
Diffstat (limited to 'src/libjin/core')
| -rw-r--r-- | src/libjin/core/game.cpp | 14 | ||||
| -rw-r--r-- | src/libjin/core/game.h | 38 | 
2 files changed, 52 insertions, 0 deletions
diff --git a/src/libjin/core/game.cpp b/src/libjin/core/game.cpp new file mode 100644 index 0000000..1c47d87 --- /dev/null +++ b/src/libjin/core/game.cpp @@ -0,0 +1,14 @@ +#include "game.h" + +namespace jin +{ +namespace core +{ + +    Game* Game::g_game = 0;  +     +    Game::Game() :run(true) {}; +     +} +} + diff --git a/src/libjin/core/game.h b/src/libjin/core/game.h new file mode 100644 index 0000000..d56b249 --- /dev/null +++ b/src/libjin/core/game.h @@ -0,0 +1,38 @@ +#ifndef __JIN_CORE_GAME_H +#define __JIN_CORE_GAME_H + +namespace jin +{ +namespace core +{ +    class Game +    { +    public: +     +        static inline Game* get() +        { +            return g_game ? g_game : (g_game = new Game()); +        } + +        inline void quit() +        { +            run = false; +        } + +        inline bool running() +        { +            return run; +        } + +    private: +     +        Game(); +         +        static Game* g_game;  +         +        bool run; +    }; +} +} + +#endif
\ No newline at end of file  | 
