2014-09-12 02:13:50 +10:00
|
|
|
#[cfg(target_os = "android")]
|
2015-01-08 19:28:22 +11:00
|
|
|
#[macro_use]
|
2014-09-12 02:13:50 +10:00
|
|
|
extern crate android_glue;
|
|
|
|
|
2016-02-23 22:56:23 +11:00
|
|
|
extern crate winit;
|
2014-07-27 18:55:37 +10:00
|
|
|
|
2014-09-12 02:13:50 +10:00
|
|
|
#[cfg(target_os = "android")]
|
2014-12-20 16:34:20 +11:00
|
|
|
android_start!(main);
|
2014-09-12 02:13:50 +10:00
|
|
|
|
2015-01-13 23:21:36 +11:00
|
|
|
fn resize_callback(width: u32, height: u32) {
|
2014-12-17 10:41:27 +11:00
|
|
|
println!("Window resized to {}x{}", width, height);
|
|
|
|
}
|
|
|
|
|
2014-07-27 18:55:37 +10:00
|
|
|
fn main() {
|
2016-11-11 22:08:46 +11:00
|
|
|
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 {
|
2016-02-23 22:56:23 +11:00
|
|
|
winit::Event::Closed => break,
|
2015-06-16 21:48:08 +10:00
|
|
|
_ => ()
|
|
|
|
}
|
2014-07-27 18:55:37 +10:00
|
|
|
}
|
|
|
|
}
|