diff options
author | chai <chaifix@163.com> | 2018-11-16 00:24:51 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-11-16 00:24:51 +0800 |
commit | 831e814ce9bdb84e86c06c4a52008f6bdaaa00d6 (patch) | |
tree | f91fccc7d2628d6e0a39886134b2bb174f5eede4 /src/libjin/Game/je_game.h | |
parent | 6dc75930fe5fe02f1af5489917752d315cf9e48f (diff) |
*合并master到minimal分支
Diffstat (limited to 'src/libjin/Game/je_game.h')
-rw-r--r-- | src/libjin/Game/je_game.h | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/src/libjin/Game/je_game.h b/src/libjin/Game/je_game.h deleted file mode 100644 index 78c3385..0000000 --- a/src/libjin/Game/je_game.h +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef __JE_CORE_GAME_H -#define __JE_CORE_GAME_H - -#include "../core/je_configuration.h" -#if defined(jin_game) - -#include "../common/je_subsystem.hpp" -#include "../utils/je_macros.h" -#include "../input/je_Event.h" - -#include "SDL2/SDL.h" - -namespace JinEngine -{ - namespace Core - { - - /// - /// Game class. - /// - class Game : public Subsystem<Game> - { - public: - - typedef void(*onLoad)(); - typedef void(*onEvent)(JinEngine::Input::Event* e); - typedef void(*onUpdate)(int dt); - typedef void(*onDraw)(); - - /// - /// Game setting. - /// - struct Setting : SettingBase - { - onEvent eventHandler; - onUpdate updater; - onDraw drawer; - onLoad loader; - }; - - /// - /// Main game loop. - /// - void run(); - - /// - /// Stop game. - /// - inline void stop() - { - _running = false; - }; - - /// - /// Return if game is running. - /// - /// @return True if game is running, otherwise return false. - /// - inline bool running() - { - return _running; - }; - - private: - - Game(); - ~Game() {}; - - singleton(Game); - - onEvent _onEvent; - onUpdate _onUpdate; - onDraw _onDraw; - onLoad _onLoad; - - bool _running; - - bool initSystem(const SettingBase* setting); - void quitSystem(); - - }; - - } // namespace Core -} // namespace JinEngine - -#endif // jin_game - -#endif // __JE_CORE_GAME_H
\ No newline at end of file |