[][src]Struct storm::Engine

pub struct Engine { /* fields omitted */ }

The main entry point into the Storm engine. All interactions with the engine are managed by the API on this type. The engine is send, and can be moved between threads.

Methods

impl Engine[src]

pub fn start(
    desc: WindowSettings,
    game_loop: impl FnMut(Engine) + Send + 'static
)
[src]

pub fn input_poll(&mut self) -> Option<InputMessage>[src]

Polls for an input message. If there are no buffered input messages, then this returns None.

pub fn batch_create(&mut self, desc: &BatchSettings) -> BatchToken[src]

Creates a new batch with the given settings and returns a token to reference the batch by later. The returned token can be freely copied.

pub fn batch_update(&mut self, batch: &BatchToken, desc: &BatchSettings)[src]

Updates the settings for an existing batch. If the token references an invalid or removed batch, this will panic.

pub fn batch_remove(&mut self, batch: &BatchToken)[src]

Removes an existing batch from the engine. If the token references an invalid or removed batch, this will panic.

pub fn sprite_set(&mut self, batch: &BatchToken, descs: &Vec<Sprite>)[src]

Sets the sprites to render for a given batch. If the token references an invalid or removed batch, this will panic.

pub fn sprite_clear(&mut self, batch: &BatchToken)[src]

Clears all sprites from the given batch. This does the same thing as passing an empty Vec to sprite_set. If the token references an invalid or removed batch, this will panic.

pub fn font_load(&mut self, path: &str) -> FontToken[src]

Loads a new font and returns a token to reference it with later.

pub fn text_set(&mut self, batch: &BatchToken, descs: &Vec<Text>)[src]

Sets the text to render for a given batch. If the token references an invalid or removed batch, this will panic.

pub fn text_clear(&mut self, batch: &BatchToken)[src]

Clears all text from the given batch. This does the same thing as passing an empty Vec to sprite_set. If the token references an invalid or removed batch, this will panic.

pub fn texture_load<P: AsRef<Path>>(
    &mut self,
    path: P,
    format: TextureFormat
) -> Texture
[src]

Loads a new texture from a given path. If there is an issue loading the texture, this function will panic.

pub fn texture_create<R: Read>(
    &mut self,
    reader: R,
    format: TextureFormat
) -> Texture
[src]

Loads a new texture from an in memory source. If there is an issue loading the texture, this function will panic.

If loading from an array, like from include_bytes!(), you can use as_ref() on the array to convert it into a readable type.

pub fn window_title(&mut self, title: &str)[src]

Sets the title of the window.

pub fn window_clear_color(&mut self, clear_color: RGBA8)[src]

Sets the clear color for the window.

pub fn window_display_mode(&mut self, display_mode: DisplayMode)[src]

Sets the display mode of the window.

pub fn window_vsync(&mut self, vsync: Vsync)[src]

Sets the vsync setting for the window.

pub fn window_commit(&mut self)[src]

Commits the queued window, batch, sprite, text, and texture related changes to the renderer. This function will not block.

Auto Trait Implementations

impl Unpin for Engine

impl !Sync for Engine

impl Send for Engine

impl !RefUnwindSafe for Engine

impl !UnwindSafe for Engine

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]