From 28aff73635635d39f6dbc29f3c82fb73023ad746 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 10 Jan 2005 09:21:35 +0000 Subject: [PATCH] Win32: Fixes for previous commit --- src/native/win32/org_lwjgl_input_Mouse.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/native/win32/org_lwjgl_input_Mouse.c b/src/native/win32/org_lwjgl_input_Mouse.c index bf9c7713..189deec4 100644 --- a/src/native/win32/org_lwjgl_input_Mouse.c +++ b/src/native/win32/org_lwjgl_input_Mouse.c @@ -179,6 +179,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_createMouse(JNIEnv *en last_x = last_y = accum_dx = accum_dy = accum_dwheel = 0; buffer_enabled = false; + mouse_grabbed = false; // Create input ret = DirectInputCreate(dll_handle, DIRECTINPUT_VERSION, &lpdi, NULL); @@ -205,11 +206,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_createMouse(JNIEnv *en ShutdownMouse(); return; } - /* Aquire the Mouse */ - ret = IDirectInputDevice_Acquire(mDIDevice); - if(FAILED(ret)) { - printfDebug("Failed to acquire mouse\n"); - } created = true; } @@ -247,7 +243,7 @@ void handleMouseButton(int button, int state) { if(created) { putMouseEvent(button, state, 0); if (button < BUTTON_STATES_SIZE) - win32_message_button_states[button] = state != 0 : JNI_TRUE: JNI_FALSE; + win32_message_button_states[button] = state != 0 ? JNI_TRUE: JNI_FALSE; } } @@ -386,13 +382,11 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_grabMouse if(grab) { if (!mouse_grabbed) { mouse_grabbed = true; - ShowCursor(false); IDirectInputDevice_Acquire(mDIDevice); } } else { if (mouse_grabbed) { mouse_grabbed = false; - ShowCursor(true); IDirectInputDevice_Unacquire(mDIDevice); } }