pub struct Game<T> {
pub audio: AudioDevice<Audio>,
pub assets: AssetSystem,
pub renderer: Renderer,
pub input: InputManager<T>,
/* private fields */
}Expand description
Everything you need to create a game.
Fields§
§audio: AudioDevice<Audio>§assets: AssetSystem§renderer: Renderer§input: InputManager<T>Implementations§
Source§impl<T: Eq + Hash + Clone> Game<T>
impl<T: Eq + Hash + Clone> Game<T>
pub fn new(title: &str, window_width: u32, window_height: u32) -> Self
pub fn update(&mut self)
pub fn draw(&mut self) -> Result<(), ()>
pub fn sdl(&self) -> &Sdl
pub fn delta(&self) -> f32
pub fn total_time(&self) -> f32
pub fn window_size(&self) -> (u32, u32)
pub fn set_window_size( &mut self, width: u32, height: u32, ) -> Result<(), IntegerOrSdlError>
pub fn window_position(&self) -> (i32, i32)
pub fn set_forced_window_position(&mut self, x: i32, y: i32)
pub fn center_window(&mut self)
pub fn window_title(&self) -> &str
pub fn set_window_title(&mut self, title: &str) -> Result<(), NulError>
pub fn set_window_icon<P: AsRef<Path>>(&mut self, path: P)
Auto Trait Implementations§
impl<T> Freeze for Game<T>
impl<T> !RefUnwindSafe for Game<T>
impl<T> !Send for Game<T>
impl<T> !Sync for Game<T>
impl<T> Unpin for Game<T>where
T: Unpin,
impl<T> !UnwindSafe for Game<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more