pub fn init(width: u32, height: u32, target_fps: u32) -> ConsoleEngine {
        assert!(target_fps > 0, "Target FPS needs to be greater than zero.");
        let mut my = ConsoleEngine {
            stdout: stdout(),
            time_limit: std::time::Duration::from_millis(1000 / target_fps as u64),
            frame_count: 0,
            width,
            height,
            screen: Screen::new(width, height),
            screen_last_frame: Screen::new_empty(width, height),
            instant: std::time::Instant::now(),
            keys_pressed: vec![],
            keys_held: vec![],
            keys_released: vec![],
            mouse_events: vec![],
        };
        my.begin();
        my.try_resize(width, height);
        my
    }
/// Initialize a screen of the provided width and height, and load the target FPS
Initialize a screen of the provided width and height, and load the target FPS
Initialize a screen of the provided width and height and load the target FPS
pub fn init(width: u32, height: u32, target_fps: u32) -> ConsoleEngine {
        assert!(target_fps > 0, "Target FPS needs to be greater than zero.");
        let mut my = ConsoleEngine {
            stdout: stdout(),
            time_limit: std::time::Duration::from_millis(1000 / target_fps as u64),
            frame_count: 0,
            width,
            height,
            screen: Screen::new(width, height),
            screen_last_frame: Screen::new_empty(width, height),
            instant: std::time::Instant::now(),
            keys_pressed: vec![],
            keys_held: vec![],
            keys_released: vec![],
            mouse_events: vec![],
        };
        my.begin();
        my.try_resize(width, height);
        my
    }
pub fn init ( width : u32 , height : u32 , target_fps : u32 ) -> ConsoleEngine { assert ! ( target_fps 0 " " ) ; let mut my = ConsoleEngine { stdout : stdout ( ) , time_limit : std :: time :: Duration :: from_millis ( 1000 / target_fps as u64 ) , frame_count : 0 , width , height , screen : Screen :: new ( width , height ) , screen_last_frame : Screen :: new_empty ( width , height ) , instant : std :: time :: Instant :: now ( ) , keys_pressed : vec ! [ ] , keys_held : vec ! [ ] , keys_released : vec ! [ ] , mouse_events : vec ! [ ] , } ; my . begin ( ) ; my . try_resize ( width , height ) ; my }
Initialize a screen of the provided width and height, and load the target FPS
Initialize a screen of the provided width and height and load the target FPS
width
u32
height
u32
target_fps
u32
width
u32
height
u32
target_fps
u32