From 11e27889aec6dfb943c6fb1aa97900e21e319bb7 Mon Sep 17 00:00:00 2001 From: Rengierof Date: Sat, 26 Dec 2015 16:38:00 +0200 Subject: Fixes cursor behavior with windows --- examples/cursor.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/cursor.rs b/examples/cursor.rs index 167c5cb..995c662 100644 --- a/examples/cursor.rs +++ b/examples/cursor.rs @@ -11,15 +11,15 @@ mod support; #[cfg(target_os = "android")] android_start!(main); -fn main() { +fn main() { let window = glutin::WindowBuilder::new().build().unwrap(); - window.set_title("A fantastic window!"); + window.set_title("A fantastic window!"); unsafe { window.make_current().unwrap() }; let context = support::load(&window); let cursors = [MouseCursor::Default, MouseCursor::Crosshair, MouseCursor::Hand, MouseCursor::Arrow, MouseCursor::Move, MouseCursor::Text, MouseCursor::Wait, MouseCursor::Help, MouseCursor::Progress, MouseCursor::NotAllowed, MouseCursor::ContextMenu, MouseCursor::NoneCursor, MouseCursor::Cell, MouseCursor::VerticalText, MouseCursor::Alias, MouseCursor::Copy, MouseCursor::NoDrop, MouseCursor::Grab, MouseCursor::Grabbing, MouseCursor::AllScroll, MouseCursor::ZoomIn, MouseCursor::ZoomOut, MouseCursor::EResize, MouseCursor::NResize, MouseCursor::NeResize, MouseCursor::NwResize, MouseCursor::SResize, MouseCursor::SeResize, MouseCursor::SwResize, MouseCursor::WResize, MouseCursor::EwResize, MouseCursor::NsResize, MouseCursor::NeswResize, MouseCursor::NwseResize, MouseCursor::ColResize, MouseCursor::RowResize]; let mut cursor_idx = 0; - + for event in window.wait_events() { match event { Event::KeyboardInput(ElementState::Pressed, _, _) => { -- cgit v1.2.3 From d2ac6cfa11899378546c1fb4b71943c83bb3dc62 Mon Sep 17 00:00:00 2001 From: Rengierof Date: Sat, 26 Dec 2015 16:47:25 +0200 Subject: Fixed grabbing example. --- examples/grabbing.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/grabbing.rs b/examples/grabbing.rs index 4b12b02..485be78 100644 --- a/examples/grabbing.rs +++ b/examples/grabbing.rs @@ -18,8 +18,8 @@ fn main() { let context = support::load(&window); let mut grabbed = false; - - for event in window.poll_events() { + + for event in window.wait_events() { match event { Event::KeyboardInput(ElementState::Pressed, _, _) => { if grabbed { @@ -33,6 +33,8 @@ fn main() { } }, + Event::Closed => break, + a @ Event::MouseMoved(_) => { println!("{:?}", a); }, @@ -44,4 +46,3 @@ fn main() { let _ = window.swap_buffers(); } } - -- cgit v1.2.3