[][src]Struct simple_game_engine::Engine

pub struct Engine<'a> { /* fields omitted */ }

The main game engine, which manages the display and input.

Implementations

impl<'a> Engine<'a>[src]

pub fn new(
    app: &'a mut dyn Application,
    title: &'a str,
    width: u32,
    height: u32
) -> Result<Engine<'a>, Box<dyn Error>>
[src]

Create a new engine.

Parameters

  • app: Defines the application's logic.
  • title: Title of the window.
  • width: Width (in pixels) of the window.
  • height: Height (in pixels) of the window.

pub fn start(&mut self, present_vsync: bool) -> Result<(), Box<dyn Error>>[src]

Create and show the window and start the main event loop.

Parameters

  • present_vsync: Whether to limit the frame rate of the application to the frame rate of the display.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Engine<'a>[src]

impl<'a> !Send for Engine<'a>[src]

impl<'a> !Sync for Engine<'a>[src]

impl<'a> Unpin for Engine<'a>[src]

impl<'a> !UnwindSafe for Engine<'a>[src]

Blanket Implementations

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

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

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

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.