pub struct Engine { /* private fields */ }
Expand description

The thing that makes the computer go

Implementations§

source§

impl Engine

source

pub fn create_texture( &mut self, path: &str ) -> Result<TextureIndex, TextureError>

Attempts to create a texture

source

pub fn is_key_down(&self, key: Key) -> bool

Checks if a key is down

source

pub fn is_key_up(&self, key: Key) -> bool

Checks if a key is up

source

pub fn is_key_pressed(&self, key: Key) -> bool

Only returns true on the frame where the key is first pressed down

source

pub fn is_key_released(&self, key: Key) -> bool

Only returns true on the frame where the key first returns back up

source

pub fn is_mouse_key_down(&self, key: MouseKey) -> bool

Checks if a mouse key is down

source

pub fn is_mouse_key_up(&self, key: MouseKey) -> bool

Checks if a mouse key is up

source

pub fn is_mouse_key_pressed(&self, key: MouseKey) -> bool

Only returns true on the frame where the key is first pressed down

source

pub fn is_mouse_key_released(&self, key: MouseKey) -> bool

Only returns true on the frame where the key first returns back up

source

pub fn get_mouse_position(&self) -> Vec2<f32>

Gives the current position of the mouse in physical pixels

source

pub fn window_has_focus(&self) -> bool

Checks if the window has focus

source

pub fn is_window_maximized(&self) -> bool

Checks if the window is maximized not fullscreened

source

pub fn is_window_minimized(&self) -> bool

Checks to see if the window is minimized

source

pub fn is_window_fullscreen(&self) -> bool

Checks to see if the window is fullscreen not maximized

source

pub fn maximize_window(&self)

Will maximize the window

source

pub fn minimize_window(&self)

Will minimize the window

source

pub fn set_window_icon(&self, path: &str) -> Result<(), IconError>

Will attempt to set the window icon for more details check the winit docs

source

pub fn set_window_title(&self, title: &str)

Sets the window title

source

pub fn set_window_position(&self, x: f32, y: f32)

Changes the Position of the window in PhysicalPixles

source

pub fn set_window_min_size(&self, width: f32, height: f32)

Sets the physical minimum size of the window

source

pub fn get_window_position(&self) -> Option<Vec2<i32>>

Gets the physical postion of the window

source

pub fn get_window_size(&self) -> Vec2<u32>

Gets the phyisical size of the window,

source

pub fn get_window_scale_factor(&self) -> f64

Gets the scale factor to help handle diffrence between phyiscial and logical pixels

source

pub fn toggle_fullscreen(&self)

Toggels fullscreen mode may fail on certain Operating Systems check the winit docs for more information

source

pub fn hide_cursor(&mut self)

Hides the cursor

source

pub fn show_cursor(&mut self)

Shows the cursor if its hidden

source

pub fn change_camera_matrix(&mut self, matrix: [f32; 16])

Will update the camera matrix as of version 0.1.0 it will effect all things drawn is also 3D

source

pub fn measure_text(&mut self, text: &str, scale: f32) -> Vec2<f32>

Measures a peice of text and gives a Vec2 of the width and height

source

pub fn run<T>(self, game: T) -> !where T: Game + 'static,

Takes the struct that implements the Game trait and starts the winit event loop running the game

Auto Trait Implementations§

§

impl !RefUnwindSafe for Engine

§

impl !Send for Engine

§

impl !Sync for Engine

§

impl Unpin for Engine

§

impl !UnwindSafe for Engine

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,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · 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.
const: unstable · source§

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

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V