mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 22:31:30 +11:00
24 lines
628 B
Rust
24 lines
628 B
Rust
extern crate winit;
|
|
|
|
use winit::dpi::LogicalSize;
|
|
|
|
fn main() {
|
|
let mut events_loop = winit::EventsLoop::new();
|
|
|
|
let window = winit::WindowBuilder::new()
|
|
.build(&events_loop)
|
|
.unwrap();
|
|
|
|
window.set_min_dimensions(Some(LogicalSize::new(400.0, 200.0)));
|
|
window.set_max_dimensions(Some(LogicalSize::new(800.0, 400.0)));
|
|
|
|
events_loop.run_forever(|event| {
|
|
println!("{:?}", event);
|
|
|
|
match event {
|
|
winit::Event::WindowEvent { event: winit::WindowEvent::CloseRequested, .. } => winit::ControlFlow::Break,
|
|
_ => winit::ControlFlow::Continue,
|
|
}
|
|
});
|
|
}
|