ifdef'ed some debug printfs

This commit is contained in:
Elias Naur 2003-09-11 08:00:28 +00:00
parent 6551d03cd4
commit fe1d693b81
2 changed files with 18 additions and 4 deletions

View File

@ -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
}

View File

@ -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;
}