Struct wasm4_sx::Engine

source ·
pub struct Engine;
Expand description

Engine: wrapper around direct layers.

Implementations§

source§

impl Engine

source

pub const FPS: u64 = 60u64

Target frames per second.

source

pub const DELTA_TIME: f32 = 0.0166666675f32

Delta time.

source

pub fn set_frame_skip(value: u32)

Set frame skip.

Set to 0 to unset.

source

pub fn run_frame<F: Fn(FrameContext)>(func: F)

Execute code for a frame.

You need to execute your game logic in the func closure to benefit from the gamepad and mouse book-keeping, plus the frame skip.

source

pub fn frame_count() -> u64

Get the current frame count.

source

pub fn frame_skipped() -> u32

Get the frame skip value.

source

pub fn palette() -> SystemPalette

Get the global palette.

source

pub fn draw_colors() -> SystemDrawColors

Get the global draw colors.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.