winit-sonoma-fix/examples/window.rs

29 lines
561 B
Rust
Raw Normal View History

2014-09-12 02:13:50 +10:00
#![feature(phase)]
#![feature(tuple_indexing)]
2014-09-12 02:13:50 +10:00
#[cfg(target_os = "android")]
#[phase(plugin, link)]
extern crate android_glue;
2014-09-21 19:33:09 +10:00
extern crate glutin;
mod support;
2014-07-27 18:55:37 +10:00
2014-09-12 02:13:50 +10:00
#[cfg(target_os = "android")]
android_start!(main)
2014-07-27 18:55:37 +10:00
fn main() {
2014-09-21 19:33:09 +10:00
let window = glutin::Window::new().unwrap();
2014-07-27 18:55:37 +10:00
2014-07-31 02:12:39 +10:00
unsafe { window.make_current() };
2014-07-27 18:55:37 +10:00
let context = support::load(&window);
2014-07-27 18:55:37 +10:00
2014-07-30 21:29:28 +10:00
while !window.is_closed() {
context.draw_frame((0.0, 1.0, 0.0, 1.0));
2014-07-27 18:55:37 +10:00
window.swap_buffers();
2014-08-07 16:53:21 +10:00
2014-09-21 19:33:09 +10:00
println!("{}", window.wait_events().collect::<Vec<glutin::Event>>());
2014-07-27 18:55:37 +10:00
}
}