Struct micro_games_kit::game::GameInstance
source · pub struct GameInstance {
pub fixed_delta_time: f32,
pub color_shader: &'static str,
pub image_shader: &'static str,
pub text_shader: &'static str,
/* private fields */
}Fields§
§fixed_delta_time: f32§color_shader: &'static str§image_shader: &'static str§text_shader: &'static strImplementations§
source§impl GameInstance
impl GameInstance
sourcepub fn new(state: impl GameState + 'static) -> Self
pub fn new(state: impl GameState + 'static) -> Self
Examples found in repository?
More examples
pub fn with_fixed_time_step(self, value: f32) -> Self
pub fn with_fps(self, frames_per_second: usize) -> Self
pub fn with_color_shader(self, name: &'static str) -> Self
pub fn with_image_shader(self, name: &'static str) -> Self
pub fn with_text_shader(self, name: &'static str) -> Self
pub fn fps(&self) -> usize
pub fn set_fps(&mut self, frames_per_second: usize)
pub fn process_frame(&mut self, graphics: &mut Graphics<Vertex>)
pub fn process_event(&mut self, event: &Event<'_, ()>) -> bool
Trait Implementations§
source§impl AppState<Vertex> for GameInstance
impl AppState<Vertex> for GameInstance
Auto Trait Implementations§
impl !RefUnwindSafe for GameInstance
impl !Send for GameInstance
impl !Sync for GameInstance
impl Unpin for GameInstance
impl !UnwindSafe for GameInstance
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
§impl<T> Initialize for Twhere
T: Default,
impl<T> Initialize for Twhere
T: Default,
fn initialize(&mut self)
§unsafe fn initialize_raw(data: *mut ())
unsafe fn initialize_raw(data: *mut ())
Safety Read more
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().