INNER CODE UNIT · Rust

run

lemunozm/ruscii · src/app.rs:111

    pub fn run<F>(&mut self, mut frame_action: F)
    where
        F: FnMut(&mut State, &mut Window),
    {
        let expected_duration = time::Duration::from_nanos(1_000_000_000 / self.config.fps as u64);
        self.state.run();

        let result = panic::catch_unwind(panic::AssertUnwindSafe(|| {
            self.window.open();
            while self.state.is_running() {
                let now = time::Instant::now();
                self.window.clear();

                self.state.keyboard.consume_key_events();
                frame_action(&mut self.state, &mut self.window);

                self.window.draw();

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…