winit-sonoma-fix/examples/window.rs
2016-11-23 19:33:44 +01:00

23 lines
494 B
Rust

extern crate winit;
fn resize_callback(width: u32, height: u32) {
println!("Window resized to {}x{}", width, height);
}
fn main() {
let window = winit::WindowBuilder::new()
.with_title("A fantastic window!")
.with_window_resize_callback(resize_callback)
.build()
.unwrap();
for event in window.wait_events() {
println!("{:?}", event);
match event {
winit::Event::Closed => break,
_ => ()
}
}
}