diff options
Diffstat (limited to 'examples/fullscreen.rs')
-rw-r--r-- | examples/fullscreen.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/fullscreen.rs b/examples/fullscreen.rs index d64224b..707fd7d 100644 --- a/examples/fullscreen.rs +++ b/examples/fullscreen.rs @@ -35,6 +35,7 @@ fn main() { }; let window = glutin::WindowBuilder::new() + .with_gl_profile(glutin::GlProfile::Compatibility) .with_title("Hello world!".to_string()) .with_fullscreen(monitor) .build() @@ -45,10 +46,15 @@ fn main() { let context = support::load(&window); - while !window.is_closed() { + for event in window.wait_events() { context.draw_frame((0.0, 1.0, 0.0, 1.0)); window.swap_buffers(); - println!("{:?}", window.wait_events().next()); + println!("{:?}", event); + + match event { + glutin::Event::Closed => break, + _ => () + } } } |