Struct fixedstep::FixedStep
[−]
[src]
pub struct FixedStep { /* fields omitted */ }
Methods
impl FixedStep
[src]
fn start(hz: f64) -> Self
[src]
Create and start a new fixedstep timer with the given frequency in Hz
fn limit(self, limit: u32) -> Self
[src]
Set the limit for how many updates can be performed between rendering. ie: the maximum number of times update() will return true between calls to render_delta
Use this if rendering on time is more important than keeping the simulation on time (which is usually the case for video games).
fn unlimit(self) -> Self
[src]
Remove the update limit
fn reset(&mut self)
[src]
Restarts the timer at the current time and clears any waiting updates.
fn update(&mut self) -> bool
[src]
Returns true if enough time has elapsed to perform another update.
fn render_delta(&mut self) -> f64
[src]
Return the amount of time (relative to the update period) since the last update tick.
Also refreshes the update counter (see the limit
method)