Struct game_time::runner::FrameRunner [] [src]

pub struct FrameRunner<C: FrameCount> { /* fields omitted */ }

A helper type for running frame simulations with a frame counter.

FrameRunner combines a GameClock and a FrameCount object, tracking each frame as well as a framerate. FrameRunner provides a tick method like GameClock, and updates both the GameClock and FrameCount objects contained.

Methods

impl<C> FrameRunner<C> where
    C: FrameCount
[src]

Construct a new FrameRunner from a GameClock and a FrameCount.

Get a reference to the contained GameClock.

Get a mutable reference to the contained GameClock.

Get a reference to the contained FrameCount.

Get a mutable reference to the contained FrameCount.

Mark the start of a new frame, updating time and frame rate statistics.

The GameTime for the new frame is returned, with the same properties as that returned from GameClock::tick.

Mark the start of a new frame with a specified wall time, updating time statistics.

This function is like tick but allows for the start time for the frame to be specified.

Perform one frame of the simulation using frame_fn.

The closure is passed the GameTime for the frame by calling tick and will call GameClock::sleep_remaining after the closure has ended.

Trait Implementations

impl<C: Debug + FrameCount> Debug for FrameRunner<C>
[src]

Formats the value using the given formatter.