Created
November 7, 2021 02:03
-
-
Save jansen44/10cc7ea0ce9b2e5804cdab1c03d64140 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use winit; | |
| const WINDOW_TITLE: &str = "Window"; | |
| const WINDOW_SIZE: (u32, u32) = (1280, 720); | |
| fn main() { | |
| let event_loop = winit::event_loop::EventLoop::new(); | |
| let _w_builder = winit::window::WindowBuilder::new() | |
| .with_title(WINDOW_TITLE) | |
| .with_inner_size(winit::dpi::PhysicalSize::new(WINDOW_SIZE.0, WINDOW_SIZE.1)) | |
| .build(&event_loop) | |
| .expect("error: Could not create window!"); | |
| event_loop.run(|evt, _, control_flow| match evt { | |
| winit::event::Event::WindowEvent { | |
| event: winit::event::WindowEvent::CloseRequested, | |
| .. | |
| } => *control_flow = winit::event_loop::ControlFlow::Exit, | |
| _ => () | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment