Change grab_cursor and ungrab_cursor to set_cursor_state

This commit is contained in:
Pierre Krieger 2015-03-26 17:04:01 +01:00
parent d6ebaaaf5c
commit 3d692870e2
7 changed files with 76 additions and 51 deletions

View file

@ -198,6 +198,23 @@ pub enum MouseCursor {
RowResize,
}
/// Describes how glutin handles the cursor.
#[derive(Debug, Copy)]
pub enum CursorState {
/// Normal cursor behavior.
Normal,
/// The cursor will be invisible when over the window.
Hide,
/// Grabs the mouse cursor. The cursor's motion will be confined to this
/// window and the window has exclusive access to further events regarding
/// the cursor.
///
/// This is useful for first-person cameras for example.
Grab,
}
/// Describes a possible format. Unused.
#[allow(missing_docs)]
#[derive(Debug, Clone)]