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; translationEnabled = false;
// Check to see if we're already initialized // Check to see if we're already initialized
if (lpdiKeyboard != NULL) { if (lpdiKeyboard != NULL) {
#ifdef _DEBUG
printf("Keyboard already created.\n"); printf("Keyboard already created.\n");
return 1; #endif
return JNI_FALSE;
} }
if (hwnd == NULL) { if (hwnd == NULL) {
#ifdef _DEBUG
printf("No window\n"); printf("No window\n");
#endif
return JNI_FALSE; return JNI_FALSE;
} }
// Create a keyboard device // Create a keyboard device
if (lpdi->CreateDevice(GUID_SysKeyboard, &lpdiKeyboard, NULL) != DI_OK) { if (lpdi->CreateDevice(GUID_SysKeyboard, &lpdiKeyboard, NULL) != DI_OK) {
#ifdef _DEBUG
printf("Failed to create keyboard\n"); printf("Failed to create keyboard\n");
#endif
return JNI_FALSE; return JNI_FALSE;
} }
if (lpdiKeyboard->SetCooperativeLevel(hwnd, DISCL_NONEXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { 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; return JNI_FALSE;
} }

View File

@ -181,6 +181,7 @@ static bool createDirectInput()
// Create input // Create input
HRESULT ret = DirectInputCreate(dll_handle, DIRECTINPUT_VERSION, &lpdi, NULL); HRESULT ret = DirectInputCreate(dll_handle, DIRECTINPUT_VERSION, &lpdi, NULL);
if (ret != DI_OK && ret != DIERR_BETADIRECTINPUTVERSION ) { if (ret != DI_OK && ret != DIERR_BETADIRECTINPUTVERSION ) {
#ifdef _DEBUG
printf("Failed to create directinput"); printf("Failed to create directinput");
switch (ret) { switch (ret) {
case DIERR_INVALIDPARAM : case DIERR_INVALIDPARAM :
@ -195,6 +196,7 @@ static bool createDirectInput()
default: default:
printf(" - Unknown failure\n"); printf(" - Unknown failure\n");
} }
#endif
return false; return false;
} else { } else {
return true; return true;
@ -342,7 +344,9 @@ static bool registerWindow()
windowClass.lpszClassName = WINDOWCLASSNAME; windowClass.lpszClassName = WINDOWCLASSNAME;
if (RegisterClass(&windowClass) == 0) { if (RegisterClass(&windowClass) == 0) {
#ifdef _DEBUG
printf("Failed to register window class\n"); printf("Failed to register window class\n");
#endif
return false; return false;
} }
#ifdef _DEBUG #ifdef _DEBUG
@ -429,7 +433,9 @@ static bool createWindow(const char * title, int x, int y, int width, int height
NULL); NULL);
if (hwnd == NULL) { if (hwnd == NULL) {
#ifdef _DEBUG
printf("Failed to create window\n"); printf("Failed to create window\n");
#endif
return false; return false;
} }