diff --git a/src/native/win32/org_lwjgl_input_Keyboard.cpp b/src/native/win32/org_lwjgl_input_Keyboard.cpp index b33a661c..56e16291 100644 --- a/src/native/win32/org_lwjgl_input_Keyboard.cpp +++ b/src/native/win32/org_lwjgl_input_Keyboard.cpp @@ -86,23 +86,31 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nCreate translationEnabled = false; // Check to see if we're already initialized if (lpdiKeyboard != NULL) { +#ifdef _DEBUG printf("Keyboard already created.\n"); - return 1; +#endif + return JNI_FALSE; } if (hwnd == NULL) { +#ifdef _DEBUG printf("No window\n"); +#endif return JNI_FALSE; } // Create a keyboard device if (lpdi->CreateDevice(GUID_SysKeyboard, &lpdiKeyboard, NULL) != DI_OK) { +#ifdef _DEBUG printf("Failed to create keyboard\n"); +#endif return JNI_FALSE; } if (lpdiKeyboard->SetCooperativeLevel(hwnd, DISCL_NONEXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { - printf("Failed to keyboard coop\n"); +#ifdef _DEBUG + printf("Failed to set keyboard cooperation mode\n"); +#endif return JNI_FALSE; } @@ -120,7 +128,7 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nCreate HRESULT ret = lpdiKeyboard->Acquire(); if(FAILED(ret)) { #if _DEBUG - printf("Failed to acquire keyboard\n"); + printf("Failed to acquire keyboard\n"); #endif } @@ -353,4 +361,4 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Keyboard_nisStateKeySet(JNIEnv *env, } return state; -} \ No newline at end of file +} diff --git a/src/native/win32/org_lwjgl_opengl_Window.cpp b/src/native/win32/org_lwjgl_opengl_Window.cpp index 4ac3175b..5cec7dad 100755 --- a/src/native/win32/org_lwjgl_opengl_Window.cpp +++ b/src/native/win32/org_lwjgl_opengl_Window.cpp @@ -181,6 +181,7 @@ static bool createDirectInput() // Create input HRESULT ret = DirectInputCreate(dll_handle, DIRECTINPUT_VERSION, &lpdi, NULL); if (ret != DI_OK && ret != DIERR_BETADIRECTINPUTVERSION ) { +#ifdef _DEBUG printf("Failed to create directinput"); switch (ret) { case DIERR_INVALIDPARAM : @@ -195,6 +196,7 @@ static bool createDirectInput() default: printf(" - Unknown failure\n"); } +#endif return false; } else { return true; @@ -342,7 +344,9 @@ static bool registerWindow() windowClass.lpszClassName = WINDOWCLASSNAME; if (RegisterClass(&windowClass) == 0) { +#ifdef _DEBUG printf("Failed to register window class\n"); +#endif return false; } #ifdef _DEBUG @@ -429,7 +433,9 @@ static bool createWindow(const char * title, int x, int y, int width, int height NULL); if (hwnd == NULL) { +#ifdef _DEBUG printf("Failed to create window\n"); +#endif return false; }