Module crayon::application [] [src]

A unified application model across all target platforms.

Application

An application needs to run on all types of esoteric host platforms. To hide trivial platform-specific details, we offers a convenient trait Application facade which defined methods, that will be called in a pre-determined order every frame.

The most intuitive and simple setup function could be something like:

Be careful when using this code, it's not being tested!
struct Window { ... }
impl Application for Window { ... }

fn main() {
    let mut engine = Engine::new();
    let window = Window::new(&mut engine).unwrap();
    engine.run(window).unrwap();
}

Engine

Engine mentioned above is the most fundamental module in crayon. It binds various essential systems in a central place, and responsible for running the main loop.

Reexports

pub use self::time::TimeSystem;
pub use self::settings::Settings;
pub use self::context::Context;

Modules

context

The context of systems that could be accessed from multi-thread environments.

errors
event

Responsible for converting window messages to input state and internal events.

settings

Functions for loading game settings.

time

Timing and stepping system.

Structs

Engine

Engine is the root object of the game application. It binds various sub-systems in a central place and takes take of trivial tasks like the execution order or life-time management.

FrameInfo

The collected information during last frame.

Traits

Application

Application is a user-friendly facade to building application, which defines a number of event functions that get executed in a pre-determined order.