diff options
| author | Mel <einebeere@gmail.com> | 2024-02-15 11:33:11 +0100 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2024-02-15 11:34:28 +0100 |
| commit | 92f63bbdbfc214849c203511bbcb1be0a4865588 (patch) | |
| tree | d82e1b31e583b5cc9538f61cad696dab5dbd84dc /src/Time.hpp | |
| parent | 87ef308220addbe4406006ceb802a7364e6f1a05 (diff) | |
| download | meowcraft-92f63bbdbfc214849c203511bbcb1be0a4865588.tar.zst meowcraft-92f63bbdbfc214849c203511bbcb1be0a4865588.zip | |
Proper input system
Diffstat (limited to 'src/Time.hpp')
| -rw-r--r-- | src/Time.hpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/Time.hpp b/src/Time.hpp index 04f22c8..64ab4a2 100644 --- a/src/Time.hpp +++ b/src/Time.hpp @@ -1,5 +1,6 @@ #pragma once +#include "Common/Pure.hpp" #include "Common/Sizes.hpp" namespace MC { @@ -14,9 +15,17 @@ public: void start_frame(); void end_frame(); - U64 total_frames() const; - Tick tick() const; - Real delta() const; + // The total number of frames that have been rendered. + // Starts at 1, with 0 being reserved as the empty value. + PURE U64 total_frames() const; + // The current frame number. + // Starts at 1, with 0 being reserved as the empty value. + // This is the same as total_frames(), but is more descriptive, sometimes. + // :) + PURE Tick tick() const; + PURE Real delta() const; + + PURE Timestamp frame_start() const; static Timestamp now(); @@ -24,7 +33,7 @@ private: static constexpr Real delta_max = 1.0 / 10.0; static constexpr Real delta_min = 1.0 / 1000.0; - U64 m_total_frames = 0; + U64 m_total_frames = 1; Timestamp m_current_frame_start = 0; Real m_delta = 0; |
