pub trait GameLoop {
type Fb: FbSurface;
// Required methods
fn update(&mut self, input: &InputState);
fn draw(&mut self, frame_buffer: &mut Self::Fb);
// Provided method
fn should_exit(&self) -> bool { ... }
}Required Associated Types§
Sourcetype Fb: FbSurface
type Fb: FbSurface
The framebuffer type the game draws into: either the engine’s RGBA
[FrameBuffer] (true-color games) or the indexed
crate::RgbaIndexedFrameBuffer (fixed-palette games).
Required Methods§
Provided Methods§
fn should_exit(&self) -> bool
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".