pub fn new(settings: EventSettings) -> Events {
        let start = Instant::now();
        Events {
            state: State::Render,
            last_update: start,
            last_frame: start,
            dt_update_in_ns: if settings.ups == 0 {
                0
            } else {
                BILLION / settings.ups
            },
            dt_frame_in_ns: BILLION / settings.max_fps,
            dt: if settings.ups == 0 {
                0.0
            } else {
                1.0 / settings.ups as f64
            },
            settings,
            first_frame: true,
        }
    }
/// Creates a new event iterator with default UPS and FPS settings.
Creates a new event iterator with default UPS and FPS settings.
Creates a new event iterator with default UPS and FPS settings .
pub fn new(settings: EventSettings) -> Events {
        let start = Instant::now();
        Events {
            state: State::Render,
            last_update: start,
            last_frame: start,
            dt_update_in_ns: if settings.ups == 0 {
                0
            } else {
                BILLION / settings.ups
            },
            dt_frame_in_ns: BILLION / settings.max_fps,
            dt: if settings.ups == 0 {
                0.0
            } else {
                1.0 / settings.ups as f64
            },
            settings,
            first_frame: true,
        }
    }
pub fn new ( settings : EventSettings ) -> Events { let start = Instant :: now ( ) ; Events { state : State :: Render , last_update : start , last_frame : start , dt_update_in_ns : if settings . ups == 0 { 0 } else { BILLION / settings . ups } , dt_frame_in_ns : BILLION / settings . max_fps , dt : if settings . ups == 0 { 0.0 } else { 1.0 / settings . ups as f64 } , settings , first_frame : true , } }
Creates a new event iterator with default UPS and FPS settings.
Creates a new event iterator with default UPS and FPS settings .
settings
EventSettings
settings
EventSettings