2014-09-11 18:13:50 +02:00
|
|
|
#[cfg(target_os = "android")]
|
2015-01-08 09:28:22 +01:00
|
|
|
#[macro_use]
|
2014-09-11 18:13:50 +02:00
|
|
|
extern crate android_glue;
|
|
|
|
|
2016-02-23 12:56:23 +01:00
|
|
|
extern crate winit;
|
2014-07-27 10:55:37 +02:00
|
|
|
|
2014-09-11 18:13:50 +02:00
|
|
|
#[cfg(target_os = "android")]
|
2014-12-19 21:34:20 -08:00
|
|
|
android_start!(main);
|
2014-09-11 18:13:50 +02:00
|
|
|
|
2015-01-13 15:21:36 +03:00
|
|
|
fn resize_callback(width: u32, height: u32) {
|
2014-12-17 09:41:27 +10:00
|
|
|
println!("Window resized to {}x{}", width, height);
|
|
|
|
}
|
|
|
|
|
2014-07-27 10:55:37 +02:00
|
|
|
fn main() {
|
2016-02-23 12:56:23 +01:00
|
|
|
let mut window = winit::WindowBuilder::new().build().unwrap();
|
2014-11-10 20:12:32 +11:00
|
|
|
window.set_title("A fantastic window!");
|
2015-01-13 15:21:36 +03:00
|
|
|
window.set_window_resize_callback(Some(resize_callback as fn(u32, u32)));
|
2014-07-27 10:55:37 +02:00
|
|
|
|
2015-06-16 13:48:08 +02:00
|
|
|
for event in window.wait_events() {
|
|
|
|
println!("{:?}", event);
|
|
|
|
|
|
|
|
match event {
|
2016-02-23 12:56:23 +01:00
|
|
|
winit::Event::Closed => break,
|
2015-06-16 13:48:08 +02:00
|
|
|
_ => ()
|
|
|
|
}
|
2014-07-27 10:55:37 +02:00
|
|
|
}
|
|
|
|
}
|