2016-11-24 01:41:53 +11:00
|
|
|
extern crate winit;
|
|
|
|
|
2018-06-15 09:42:18 +10:00
|
|
|
use winit::dpi::LogicalSize;
|
|
|
|
|
2016-11-24 01:41:53 +11:00
|
|
|
fn main() {
|
2017-06-08 00:12:41 +10:00
|
|
|
let mut events_loop = winit::EventsLoop::new();
|
2017-01-29 01:45:01 +11:00
|
|
|
|
2018-03-23 20:35:35 +11:00
|
|
|
let window = winit::WindowBuilder::new()
|
2017-01-29 01:45:01 +11:00
|
|
|
.build(&events_loop)
|
2016-11-24 01:41:53 +11:00
|
|
|
.unwrap();
|
|
|
|
|
2018-06-15 09:42:18 +10:00
|
|
|
window.set_min_dimensions(Some(LogicalSize::new(400.0, 200.0)));
|
|
|
|
window.set_max_dimensions(Some(LogicalSize::new(800.0, 400.0)));
|
2018-03-23 20:35:35 +11:00
|
|
|
|
2017-01-29 01:45:01 +11:00
|
|
|
events_loop.run_forever(|event| {
|
|
|
|
println!("{:?}", event);
|
|
|
|
|
2016-11-24 01:41:53 +11:00
|
|
|
match event {
|
2018-04-25 06:20:40 +10:00
|
|
|
winit::Event::WindowEvent { event: winit::WindowEvent::CloseRequested, .. } => winit::ControlFlow::Break,
|
2017-06-08 00:12:41 +10:00
|
|
|
_ => winit::ControlFlow::Continue,
|
2016-11-24 01:41:53 +11:00
|
|
|
}
|
2017-01-29 01:45:01 +11:00
|
|
|
});
|
2016-11-24 01:41:53 +11:00
|
|
|
}
|