winit-sonoma-fix/examples/window.rs

23 lines
494 B
Rust
Raw Normal View History

extern crate winit;
2014-07-27 18:55:37 +10:00
fn resize_callback(width: u32, height: u32) {
println!("Window resized to {}x{}", width, height);
}
2014-07-27 18:55:37 +10:00
fn main() {
let window = winit::WindowBuilder::new()
.with_title("A fantastic window!")
.with_window_resize_callback(resize_callback)
.build()
.unwrap();
2014-07-27 18:55:37 +10:00
2015-06-16 21:48:08 +10:00
for event in window.wait_events() {
println!("{:?}", event);
match event {
winit::Event::Closed => break,
2015-06-16 21:48:08 +10:00
_ => ()
}
2014-07-27 18:55:37 +10:00
}
}