aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: 424f3fc1bfa0fdd78e3201e5ab61be2cc6686235 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use std::time::Duration;

use minifb::{Key, Window, WindowOptions};

const WIDTH: usize = 1600;
const HEIGHT: usize = 900;

fn main() {
    let mut buffer: Vec<u32> = vec![0; WIDTH * HEIGHT];

    let mut window = Window::new(
        "the Hope system",
        WIDTH,
        HEIGHT,
        WindowOptions::default()
    ).unwrap();

    window.limit_update_rate(Some(Duration::from_millis(16)));

    while window.is_open() && !window.is_key_down(Key::Escape) {
        window
            .update_with_buffer(&buffer, WIDTH, HEIGHT)
            .unwrap();
    }
}