[−][src]Struct all_is_cubes::universe::FrameClock
Algorithm for deciding how to execute simulation and rendering frames. Platform-independent; only returns decisions given provided information.
Implementations
impl FrameClock
[src]
pub fn new() -> Self
[src]
pub fn advance_to(&mut self, instant: Instant)
[src]
Advance the clock using a source of absolute time.
This cannot be meaningfully used in combination with request_frame()
.
#[must_use]pub fn request_frame(&mut self, time_since_last_frame: Duration) -> bool
[src]
Reacts to a callback from the environment requesting drawing a frame ASAP if we're going to (i.e. requestAnimationFrame on the web). Drives the simulation clock based on this input (it will not advance if no requests are made).
Returns whether a frame should actually be rendered now. The caller should also
consult should_step()
afterward to schedule game state steps.
This cannot be meaningfully used in combination with advance_to()
.
pub fn should_draw(&self) -> bool
[src]
pub fn did_draw(&mut self)
[src]
pub fn should_step(&self) -> bool
[src]
pub fn step_length(&self) -> Duration
[src]
pub fn did_step(&mut self)
[src]
Trait Implementations
impl Default for FrameClock
[src]
Auto Trait Implementations
impl RefUnwindSafe for FrameClock
impl Send for FrameClock
impl Sync for FrameClock
impl Unpin for FrameClock
impl UnwindSafe for FrameClock
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,