Function radiant_utils::loops::mainloop[][src]

pub fn mainloop<F, G>(interval: Duration, state_callback: F, render_callback: G) where
    F: FnMut(LoopState) -> bool,
    G: FnMut(LoopState) -> bool

Main loop helper function. Provides callbacks for game state changes and rendering. Calls state_callback multiple times if the actual render_callback call interval exceeds the given interval. Both callbacks receive a LoopState object containing frame delta and fps data.