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,
/* private fields */
}
Fields
game: G
updates_per_second: u32
max_frame_time: f64
exit_next_iteration: bool
window: W
Implementations
sourceimpl<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 where
U: FnMut(&mut GameLoop<G, T, W>),
R: FnMut(&mut GameLoop<G, T, W>),
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) -> u32
pub fn number_of_renders(&self) -> u32
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> RefUnwindSafe for GameLoop<G, T, W> where
G: RefUnwindSafe,
T: RefUnwindSafe,
W: RefUnwindSafe,
impl<G, T, W> Send for GameLoop<G, T, W> where
G: Send,
T: Send,
W: Send,
impl<G, T, W> Sync for GameLoop<G, T, W> where
G: Sync,
T: Sync,
W: Sync,
impl<G, T, W> Unpin for GameLoop<G, T, W> where
G: Unpin,
T: Unpin,
W: Unpin,
impl<G, T, W> UnwindSafe for GameLoop<G, T, W> where
G: UnwindSafe,
T: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more