[][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(&mut self, path: &str) -> Texture[src]

Loads a new texture.

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

Sets the title of 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 Send for Engine

impl Unpin for Engine

impl !Sync for Engine

impl !UnwindSafe for Engine

impl !RefUnwindSafe 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.