diff options
author | Aki <please@ignore.pl> | 2023-02-10 23:47:39 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2023-02-10 23:47:39 +0100 |
commit | d6687be6a89ebd55fa9f3438d742bbf9cf4c9afa (patch) | |
tree | 943ec88bc6ef910af862328a82ff8251f6474b88 /engine/src | |
parent | b6f4678d6466e2b16f32d4fd350b10af5720dd11 (diff) | |
download | kurator-d6687be6a89ebd55fa9f3438d742bbf9cf4c9afa.zip kurator-d6687be6a89ebd55fa9f3438d742bbf9cf4c9afa.tar.gz kurator-d6687be6a89ebd55fa9f3438d742bbf9cf4c9afa.tar.bz2 |
Created scaled Clock for consistent access to update times
Diffstat (limited to 'engine/src')
-rw-r--r-- | engine/src/Clock.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
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 <kurator/engine/Clock.h> + +#include <raylib.h> + + +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 |