The different timestep modes that a game can have.
Serialization and deserialization of this type (via Serde)
can be enabled via the
In fixed timestep mode, updates will happen at a consistent rate (the
f64 value in the enum
variant representing the number of times per second), while rendering will happen as fast as
the hardware (and vsync settings) will allow.
This has the advantage of making your game’s updates deterministic, so they will act the same on hardware of different speeds. However, it can lead to some slight stutter if your rendering code does not account for the possibility for updating and rendering to be out of sync with each other.
This mode is currently the default.
In variable timestep mode, updates and rendering will happen in lockstep, one after the other, as fast as the hardware (and vsync settings) will allow.
This has the advantage of being simple to reason about (updates can never happen multiple times or get skipped), but is not deterministic, so your updates may not act the same on every run of the game loop.
To integrate the amount of time that has passed into your game’s calculations, use
impl RefUnwindSafe for Timestep
impl UnwindSafe for Timestep
type Owned = T
The resulting type after obtaining ownership.
pub fn clone_into(&self, target: &mut T)[src]
type Error = Infallible
The type returned in the event of a conversion error.