Expand description

Provides sdl2 integrations for wolf_engine.

Installation

Add this package, and sdl2 to your project’s dependencies:

wolf_engine_sdl2 = "*"
sdl2 = "*"

Example

The main job of this package is to provide thin Subcontext wrappers around the normal sdl2 types, and a Plugin to set everything up, allowing wolf_engine to manage sdl2 for you. The sdl2 objects are accessible through public fields on the Subcontexts, and their normal usage is not changed.

Load the SdlPlugin with the EngineBuilder at startup.

use wolf_engine::*;
use wolf_engine_sdl2::*;

EngineBuilder::new()
    .with_plugin(Box::from(SdlPlugin::default()))
    .build()
    .unwrap()
    .run(Box::from(my_game));

SDL Subcontexts can be accessed through the Context object.

let mut sdl_video = context.borrow_mut::<SdlVideoContext>().unwrap();
sdl_video.canvas.clear();
sdl_video.canvas.present();

For a more complete usage example, see the Quickstart Example.

Structs

Provides access to sdl2’s AudioSubsystem.

Provides access to the main Sdl instance.

Provides sdl2 integrations for wolf_engine.

Build and customize an instance of SdlPlugin.

Provides access to sdl2’s WindowCanvas and VideoSubsystem.

Settings for creating the SDL window.