diff options
Diffstat (limited to 'src/core/application.h')
-rw-r--r-- | src/core/application.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/core/application.h b/src/core/application.h index 37b70c2..cdaef67 100644 --- a/src/core/application.h +++ b/src/core/application.h @@ -8,6 +8,7 @@ #define __INCLUDED_CORE_APPLICATION_H__ #include "sys/sys.h" +#include "sys/timer.h" #include "core/commandbuffer.h" #include "core/cvar.h" @@ -30,14 +31,16 @@ public: /*----- inspectors ----------------------------------------------- */ - /// the current application time, in microseconds + /// the current application time, in milliseconds inline unsigned long timestamp() const { - return application_timestamp; + return application_timer.timestamp(); } - - /// the current application time, in seconds - float time() const { - return ((float)(timestamp()) / 1000.0f); + + /** + * @brief return the current application time, in seconds. + * */ + inline float time() const { + return (float) application_timer.timestamp() / 1000.0f; } /// true if the core is connected to a running game interface @@ -99,7 +102,7 @@ public: protected: /// run a core frame - virtual void frame(unsigned long timestamp); + virtual void frame(); /// load cvar config void load_config(); @@ -114,8 +117,8 @@ protected: void load_commandline(int count, char **argments); private: - /// time the core has been running - unsigned long application_timestamp; + /// main loop timer + sys::Timer application_timer; GameInterface *application_game; |