assert that Window has been created

This commit is contained in:
Brian Matzon 2004-01-12 17:15:41 +00:00
parent 9dd52c6559
commit ea4fed18c4
1 changed files with 7 additions and 0 deletions

View File

@ -116,6 +116,13 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Controller_initIDs(JNIEnv * env, jcl
* Called when the Controller instance is to be created
*/
JNIEXPORT void JNICALL Java_org_lwjgl_input_Controller_nCreate(JNIEnv *env, jclass clazz) {
// assert that window has been created
if(hwnd == NULL) {
throwException(env, "Please create the window before initializing input devices\n");
return;
}
// Create the DirectInput object.
HRESULT hr;
hr = DirectInputCreate(dll_handle, DIRECTINPUT_VERSION, &cDI, NULL);