diff options
Diffstat (limited to 'src/libjin/time/je_timer.h')
-rw-r--r-- | src/libjin/time/je_timer.h | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/src/libjin/time/je_timer.h b/src/libjin/time/je_timer.h index a918d63..1209827 100644 --- a/src/libjin/time/je_timer.h +++ b/src/libjin/time/je_timer.h @@ -12,15 +12,15 @@ namespace JinEngine { - namespace Time - { + namespace Time + { /// /// /// - class Timer : public Object - { - public: + class Timer : public Object + { + public: typedef std::function<void(void*)> TimerCallback; @@ -58,32 +58,32 @@ namespace JinEngine /// /// /// - Timer(); + Timer(); /// /// /// - ~Timer(); + ~Timer(); /// /// /// - void update(float dt); + void update(float dt); /// /// /// - Handler* every(float dt, TimerCallback callback, void* paramters = nullptr, FinishCallback finish = nullptr); + Handler* every(float dt, TimerCallback callback, void* paramters = nullptr, FinishCallback finish = nullptr); /// /// /// - Handler* after(float dt, TimerCallback callback, void* paramters, FinishCallback finish); + Handler* after(float dt, TimerCallback callback, void* paramters, FinishCallback finish); /// /// /// - Handler* repeat(float dt, int count, TimerCallback callback, void* paramters, FinishCallback finish); + Handler* repeat(float dt, int count, TimerCallback callback, void* paramters, FinishCallback finish); /// /// @@ -95,43 +95,43 @@ namespace JinEngine /// void cancelAll(); - private: + private: - std::vector<Handler*> mHandlers; + std::vector<Handler*> mHandlers; - }; + }; /// /// /// - inline void sleep(int ms) - { - #if jin_time == jin_time_sdl - SDL_Delay(ms); - #endif - } + inline void sleep(int ms) + { + #if jin_time == jin_time_sdl + SDL_Delay(ms); + #endif + } /// /// /// - inline double getSecond() - { - #if jin_time == jin_time_sdl - return SDL_GetTicks() / 1000.f; - #endif - } + inline double getSecond() + { + #if jin_time == jin_time_sdl + return SDL_GetTicks() / 1000.f; + #endif + } /// /// /// - inline double getMilliSecond() - { - #if jin_time == jin_time_sdl - return SDL_GetTicks(); - #endif - } - - } // namespace Time + inline double getMilliSecond() + { + #if jin_time == jin_time_sdl + return SDL_GetTicks(); + #endif + } + + } // namespace Time } // namespace JinEngine #endif // defined(jin_time) |