diff options
author | Aaditya Dhruv <[email protected]> | 2022-12-30 23:13:49 -0600 |
---|---|---|
committer | Aaditya Dhruv <[email protected]> | 2022-12-30 23:13:49 -0600 |
commit | cf4260dd64485720f263b21e4ded42248d55adb9 (patch) | |
tree | 5e3d605dd8e6d1c050b30e88df4feffe66bb916c | |
parent | 4ad6b7cf18afc95f29d7def48185901503a3a563 (diff) |
refactor main.rs
-rw-r--r-- | src/main.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs index 531a4ce..888d0f4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,17 +4,14 @@ use sdl2::pixels::Color; use sdl2::event::Event; use sdl2::keyboard::Keycode; use std::time::Duration; - -static WIDTH : u32 = 32; -static HEIGHT : u32 = 64; -static SCALE : u32 = 10; +use chip8::Chip; pub fn main() { + let chip = Chip::new(); let sdl_context = sdl2::init().unwrap(); let video_subsystem = sdl_context.video().unwrap(); - - let window = video_subsystem.window("CHIP-8", WIDTH * SCALE, HEIGHT * SCALE) + let window = video_subsystem.window("CHIP-8", chip8::WIDTH * chip8::SCALE, chip8::HEIGHT * chip8::SCALE) .position_centered() .build() .unwrap(); |