QuasarEngine
Cross-platform 3D engine and editor
Loading...
Searching...
No Matches
Timestep.h
Go to the documentation of this file.
1#pragma once
2
7
8namespace Quasar
9{
15 {
16 public:
18 constexpr Timestep() = default;
19
22 constexpr explicit Timestep(float seconds) : m_Seconds(seconds) {}
23
25 constexpr float GetSeconds() const { return m_Seconds; }
26
28 constexpr float GetMilliseconds() const { return m_Seconds * 1000.0f; }
29
31 constexpr operator float() const { return m_Seconds; }
32
33 private:
34 float m_Seconds = 0.0f;
35 };
36}
constexpr Timestep()=default
Creates a Timestep of 0 seconds.
constexpr Timestep(float seconds)
Creates a Timestep of the given number of seconds.
Definition Timestep.h:22
constexpr float GetMilliseconds() const
Returns the duration in milliseconds.
Definition Timestep.h:28
constexpr float GetSeconds() const
Returns the duration in seconds.
Definition Timestep.h:25
Contains all the engine code.