Added debugging
This commit is contained in:
parent
86883c66c1
commit
da186e5057
|
@ -326,6 +326,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_pollMouse(JNIEnv * env
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_grabMouse
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_grabMouse
|
||||||
(JNIEnv * env, jobject self, jboolean grab) {
|
(JNIEnv * env, jobject self, jboolean grab) {
|
||||||
|
HRESULT di_res;
|
||||||
IDirectInputDevice_Unacquire(mDIDevice);
|
IDirectInputDevice_Unacquire(mDIDevice);
|
||||||
if(grab) {
|
if(grab) {
|
||||||
if (!mouse_grabbed) {
|
if (!mouse_grabbed) {
|
||||||
|
@ -341,6 +342,23 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_grabMouse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
IDirectInputDevice_Unacquire(mDIDevice);
|
IDirectInputDevice_Unacquire(mDIDevice);
|
||||||
|
di_res = IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), mouseMask);
|
||||||
|
switch (di_res) {
|
||||||
|
case DI_OK:
|
||||||
|
break;
|
||||||
|
case DIERR_INVALIDPARAM:
|
||||||
|
throwException(env, "Could not set the CooperativeLevel (DIERR_INVALIDPARAM).");
|
||||||
|
return;
|
||||||
|
case DIERR_NOTINITIALIZED:
|
||||||
|
throwException(env, "Could not set the CooperativeLevel (DIERR_NOTINITIALIZED).");
|
||||||
|
return;
|
||||||
|
case E_HANDLE:
|
||||||
|
throwException(env, "Could not set the CooperativeLevel (E_HANDLE).");
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
throwException(env, "Could not set the CooperativeLevel (Unkown error code).");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), mouseMask) != DI_OK) {
|
if (IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), mouseMask) != DI_OK) {
|
||||||
throwException(env, "Could not set the CooperativeLevel.");
|
throwException(env, "Could not set the CooperativeLevel.");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue