pub struct PixEngine { /* private fields */ }
Expand description

The core engine that maintains the render loop, state, drawing functions, event handling, etc.

Implementations

Constructs a default Builder which can build a PixEngine instance.

See Builder for examples.

Starts the PixEngine application and begins executing the frame loop on a given application which must implement AppState. The only required method of which is AppState::on_update.

Errors

Any error in the entire library can propagate here and terminate the program. See the error module for details. Also see AppState::on_stop.

Example
fn main() -> PixResult<()> {
    let mut engine = PixEngine::builder().build()?;
    let mut app = MyApp::new(); // MyApp implements `AppState`
    engine.run(&mut app)
}

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.