removed restriction about native cursors, and fixed mouse not showing on setNativeCursor(null);

This commit is contained in:
Brian Matzon 2004-04-12 10:37:50 +00:00
parent e034c76f19
commit 84eae4c6f6
1 changed files with 2 additions and 5 deletions

View File

@ -244,8 +244,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nSetNativeCursor
} else { } else {
if (usingNativeCursor) { if (usingNativeCursor) {
SetClassLong(hwnd, GCL_HCURSOR, (LONG)NULL); SetClassLong(hwnd, GCL_HCURSOR, (LONG)NULL);
SetCursor(NULL); SetCursor(LoadCursor(NULL, IDC_ARROW));
ShowCursor(TRUE);
mDIDevice->Unacquire(); mDIDevice->Unacquire();
if(mDIDevice->SetCooperativeLevel(hwnd, mouseMask) != DI_OK) { if(mDIDevice->SetCooperativeLevel(hwnd, mouseMask) != DI_OK) {
throwException(env, "Could not set the CooperativeLevel."); throwException(env, "Could not set the CooperativeLevel.");
@ -253,6 +252,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nSetNativeCursor
} }
usingNativeCursor = false; usingNativeCursor = false;
mDIDevice->Acquire(); mDIDevice->Acquire();
ShowCursor(TRUE);
} }
} }
} }
@ -305,9 +305,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nPoll(JNIEnv * env, jclass cla
*/ */
JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nGrabMouse JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nGrabMouse
(JNIEnv * env, jclass clazz, jboolean grab) { (JNIEnv * env, jclass clazz, jboolean grab) {
if(usingNativeCursor) {
return;
}
if(grab) { if(grab) {
mouseMask = DISCL_EXCLUSIVE | DISCL_FOREGROUND; mouseMask = DISCL_EXCLUSIVE | DISCL_FOREGROUND;