diff options
author | chai <chaifix@163.com> | 2020-02-11 11:29:07 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-02-11 11:29:07 +0800 |
commit | 160e1299ef3d95f8e8c48706d7f61dd3dc6c6b60 (patch) | |
tree | abe5ae5242d9cc6caf6edf103e662c44e978fca0 /src/libjin/game/application.h | |
parent | e095043485d1d298571af6d9eca7f0db9009ea7a (diff) |
Diffstat (limited to 'src/libjin/game/application.h')
-rw-r--r-- | src/libjin/game/application.h | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/src/libjin/game/application.h b/src/libjin/game/application.h index 4c4f48b..7853e2b 100644 --- a/src/libjin/game/application.h +++ b/src/libjin/game/application.h @@ -12,71 +12,71 @@ namespace JinEngine { - namespace Game - { - - /// - /// Game class. - /// - class Application : public Subsystem<Application> - { - public: - typedef void(*onLoad)(); - typedef void(*onEvent)(JinEngine::Input::Event* e); - typedef void(*onUpdate)(int dt); - typedef void(*onDraw)(); - - Application(); - ~Application() {}; - - /// - /// 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: - onEvent _onEvent; - onUpdate _onUpdate; - onDraw _onDraw; - onLoad _onLoad; - - bool _running; - - bool startSystem(const SettingBase* setting); - void quitSystem(); - - }; - - } // namespace Core + namespace Game + { + + /// + /// Game class. + /// + class Application : public Subsystem<Application> + { + public: + typedef void(*onLoad)(); + typedef void(*onEvent)(JinEngine::Input::Event* e); + typedef void(*onUpdate)(int dt); + typedef void(*onDraw)(); + + Application(); + ~Application() {}; + + /// + /// 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: + onEvent _onEvent; + onUpdate _onUpdate; + onDraw _onDraw; + onLoad _onLoad; + + bool _running; + + bool startSystem(const SettingBase* setting); + void quitSystem(); + + }; + + } // namespace Core } // namespace JinEngine #endif // jin_game |