aboutsummaryrefslogtreecommitdiff
path: root/src/window.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.rs')
-rw-r--r--src/window.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/window.rs b/src/window.rs
index e42151fd..aec4b76d 100644
--- a/src/window.rs
+++ b/src/window.rs
@@ -16,9 +16,12 @@ use std::fmt::{self, Display};
use std::ops::Deref;
use gl;
-use glutin::{self, EventsLoop, WindowBuilder, Event, MouseCursor, CursorState, ControlFlow, ContextBuilder};
+use glutin::{self, ContextBuilder, ControlFlow, CursorState, Event, EventsLoop,
+ MouseCursor as GlutinMouseCursor, WindowBuilder};
use glutin::GlContext;
+use MouseCursor;
+
use config::WindowConfig;
/// Window errors
@@ -200,7 +203,7 @@ impl Window {
let window = ::glutin::GlWindow::new(window, context, &event_loop)?;
// Text cursor
- window.set_cursor(MouseCursor::Text);
+ window.set_cursor(GlutinMouseCursor::Text);
// Set OpenGL symbol loader
gl::load_with(|symbol| window.get_proc_address(symbol) as *const _);
@@ -284,6 +287,14 @@ impl Window {
self.window.set_title(title);
}
+ #[inline]
+ pub fn set_mouse_cursor(&self, cursor: MouseCursor) {
+ self.window.set_cursor(match cursor {
+ MouseCursor::Arrow => GlutinMouseCursor::Arrow,
+ MouseCursor::Text => GlutinMouseCursor::Text,
+ });
+ }
+
/// Set cursor visible
pub fn set_cursor_visible(&mut self, visible: bool) {
if visible != self.cursor_visible {