pub struct GameLoop<G, T: TimeTrait, W> {
pub game: G,
pub updates_per_second: u32,
pub max_frame_time: f64,
pub exit_next_iteration: bool,
pub window: W,
pub window_occluded: bool,
/* private fields */
}
Fields§
§game: G
§updates_per_second: u32
§max_frame_time: f64
§exit_next_iteration: bool
§window: W
§window_occluded: bool
Implementations§
Source§impl<G, T: TimeTrait, W> GameLoop<G, T, W>
impl<G, T: TimeTrait, W> GameLoop<G, T, W>
pub fn new( game: G, updates_per_second: u32, max_frame_time: f64, window: W, ) -> Self
pub fn next_frame<U, R>(&mut self, update: U, render: R) -> bool
pub fn re_accumulate(&mut self)
pub fn exit(&mut self)
pub fn set_updates_per_second(&mut self, new_updates_per_second: u32)
pub fn fixed_time_step(&self) -> f64
pub fn number_of_updates(&self) -> u64
pub fn number_of_renders(&self) -> u64
pub fn last_frame_time(&self) -> f64
pub fn running_time(&self) -> f64
pub fn accumulated_time(&self) -> f64
pub fn blending_factor(&self) -> f64
pub fn previous_instant(&self) -> T
pub fn current_instant(&self) -> T
Auto Trait Implementations§
impl<G, T, W> Freeze for GameLoop<G, T, W>
impl<G, T, W> RefUnwindSafe for GameLoop<G, T, W>
impl<G, T, W> Send for GameLoop<G, T, W>
impl<G, T, W> Sync for GameLoop<G, T, W>
impl<G, T, W> Unpin for GameLoop<G, T, W>
impl<G, T, W> UnwindSafe for GameLoop<G, T, W>
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