diff options
author | Melody Horn <melody@boringcactus.com> | 2021-03-07 04:33:45 -0700 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-03-07 04:33:45 -0700 |
commit | 42ad3cae0589dfd73412945f680cf1e1ed44377a (patch) | |
tree | 9011e5fb01151fdc8ea11e61224b56673e32a432 /src | |
parent | a60a2259ccbadacc219dbbbcc651cfd0f331479b (diff) | |
download | hope-42ad3cae0589dfd73412945f680cf1e1ed44377a.tar.gz hope-42ad3cae0589dfd73412945f680cf1e1ed44377a.zip |
display a blank screen
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index f328e4d..424f3fc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1 +1,25 @@ -fn main() {} +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(); + } +} |