*** empty log message ***
This commit is contained in:
parent
310526a254
commit
0f88a2131b
|
@ -60,7 +60,6 @@ JNIEnv* mEnvironment; // JNIEnvironment copy
|
||||||
|
|
||||||
bool mCreate_success; // bool used to determine successfull creation
|
bool mCreate_success; // bool used to determine successfull creation
|
||||||
bool mFirstTimeInitialization = true; // boolean to determine first time initialization
|
bool mFirstTimeInitialization = true; // boolean to determine first time initialization
|
||||||
jobject mButtonsReference = NULL; // reference to buttons array so it won't get GC'ed
|
|
||||||
|
|
||||||
// Cached fields of Mouse.java
|
// Cached fields of Mouse.java
|
||||||
jclass clsMouse;
|
jclass clsMouse;
|
||||||
|
@ -116,10 +115,8 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nCreate(JNIEnv *env, jclas
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mCreate_success) {
|
/* Do setup of Mouse */
|
||||||
/* Do setup of Mouse */
|
SetupMouse();
|
||||||
SetupMouse();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Initialize any fields on the Mouse */
|
/* Initialize any fields on the Mouse */
|
||||||
InitializeMouseFields();
|
InitializeMouseFields();
|
||||||
|
@ -144,7 +141,7 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nCreate(JNIEnv *env, jclas
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return mCreate_success;
|
return mCreate_success ? JNI_TRUE : JNI_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -174,10 +171,8 @@ void ShutdownMouse() {
|
||||||
if (mDIDevice != NULL) {
|
if (mDIDevice != NULL) {
|
||||||
mDIDevice->Unacquire();
|
mDIDevice->Unacquire();
|
||||||
mDIDevice->Release();
|
mDIDevice->Release();
|
||||||
|
mDIDevice = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//delete global reference, since we're done
|
|
||||||
mEnvironment->DeleteGlobalRef(mButtonsReference);
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Enumerates the capabilities of the Mouse attached to the system
|
* Enumerates the capabilities of the Mouse attached to the system
|
||||||
|
@ -263,9 +258,6 @@ void InitializeMouseFields() {
|
||||||
//create buttons array
|
//create buttons array
|
||||||
jbooleanArray mButtonsArray = mEnvironment->NewBooleanArray(mButtoncount);
|
jbooleanArray mButtonsArray = mEnvironment->NewBooleanArray(mButtoncount);
|
||||||
|
|
||||||
//create reference so it won't get GC'ed
|
|
||||||
mButtonsReference = mEnvironment->NewGlobalRef(mButtonsArray);
|
|
||||||
|
|
||||||
//set buttons array
|
//set buttons array
|
||||||
mEnvironment->SetStaticObjectField(clsMouse, fidMButtons, (jbooleanArray) mButtonsReference);
|
mEnvironment->SetStaticObjectField(clsMouse, fidMButtons, (jbooleanArray) mButtonsReference);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue