Trait EngineCallbacks

Source
pub trait EngineCallbacks {
    // Required methods
    fn run_frame(
        &mut self,
        platform: &dyn Platform,
        run_game_frame: &mut dyn FnMut(Instant, &dyn Platform, &mut Self),
    );
    fn event(&mut self, event: Event, timestamp: Instant);
}
Expand description

Interface to the engine for the platform implementation.

Used to allow engine to do its thing each frame, and to pass events to it.

Required Methods§

Source

fn run_frame( &mut self, platform: &dyn Platform, run_game_frame: &mut dyn FnMut(Instant, &dyn Platform, &mut Self), )

Run one frame of the game loop.

Source

fn event(&mut self, event: Event, timestamp: Instant)

Handle an event.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§