From d6687be6a89ebd55fa9f3438d742bbf9cf4c9afa Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 10 Feb 2023 23:47:39 +0100 Subject: Created scaled Clock for consistent access to update times --- engine/src/Clock.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 engine/src/Clock.cpp (limited to 'engine/src') diff --git a/engine/src/Clock.cpp b/engine/src/Clock.cpp new file mode 100644 index 0000000..5261603 --- /dev/null +++ b/engine/src/Clock.cpp @@ -0,0 +1,33 @@ +#include + +#include + + +namespace kurator +{ +namespace engine +{ + + +float +Clock::dt() const +{ + return GetFrameTime() * time_factor; +} + + +float +Clock::ui() const +{ + return GetFrameTime(); +} + + +Clock::operator float() const +{ + return dt(); +} + + +} // namespace engine +} // namespace kurator -- cgit v1.1