Partially implement cursor state on win32

This commit is contained in:
Pierre Krieger 2015-03-26 17:32:40 +01:00
parent c3470abc8e
commit bb418efcc7
2 changed files with 60 additions and 4 deletions

View file

@ -15,11 +15,13 @@ use Api;
use BuilderAttribs;
use CreationError;
use CreationError::OsError;
use CursorState;
use GlRequest;
use PixelFormat;
use std::ffi::CString;
use std::sync::mpsc::channel;
use std::sync::Mutex;
use libc;
use super::gl;
@ -250,6 +252,7 @@ unsafe fn init(title: Vec<u16>, builder: BuilderAttribs<'static>,
gl_library: gl_library,
events_receiver: events_receiver,
is_closed: AtomicBool::new(false),
cursor_state: Mutex::new(CursorState::Normal),
})
}
@ -265,7 +268,7 @@ unsafe fn register_window_class() -> Vec<u16> {
cbWndExtra: 0,
hInstance: kernel32::GetModuleHandleW(ptr::null()),
hIcon: ptr::null_mut(),
hCursor: ptr::null_mut(),
hCursor: ptr::null_mut(), // must be null in order for cursor state to work properly
hbrBackground: ptr::null_mut(),
lpszMenuName: ptr::null(),
lpszClassName: class_name.as_ptr(),