*** empty log message ***

This commit is contained in:
Caspian Rychlik-Prince 2003-08-07 21:53:06 +00:00
parent 8c419814d6
commit 0886f84ed8
4 changed files with 72 additions and 26 deletions

View File

@ -191,4 +191,9 @@ public final class Sys {
*/
public static native void alert(String title, String message);
/*
* Cas: this is just a debugging aid. The native code is also commented out.
*
public static native int getDirectBufferAddress(Buffer buf);
*/
}

View File

@ -19,7 +19,7 @@ extern "C" {
/* Inaccessible static: LIBRARY_NAME */
/* Inaccessible static: DEBUG */
/* Inaccessible static: _debug */
/* Inaccessible static: class_00024org_00024lwjgl_00024Sys */
/* Inaccessible static: class_000240 */
/*
* Class: org_lwjgl_Sys
* Method: getTimerResolution
@ -60,6 +60,14 @@ JNIEXPORT void JNICALL Java_org_lwjgl_Sys_setProcessPriority
JNIEXPORT void JNICALL Java_org_lwjgl_Sys_alert
(JNIEnv *, jclass, jstring, jstring);
/*
* Class: org_lwjgl_Sys
* Method: getDirectBufferAddress
* Signature: (Ljava/nio/Buffer;)I
JNIEXPORT jint JNICALL Java_org_lwjgl_Sys_getDirectBufferAddress
(JNIEnv *, jclass, jobject);
*/
#ifdef __cplusplus
}
#endif

View File

@ -273,11 +273,15 @@ JNIEXPORT void JNICALL Java_org_lwjgl_Display_resetDisplayMode
// Return device gamma to normal
HDC screenDC = GetDC(NULL);
if (!SetDeviceGammaRamp(screenDC, originalGamma)) {
#ifdef _DEBUG
printf("Could not reset device gamma\n");
#endif
}
try {
if (!SetDeviceGammaRamp(screenDC, originalGamma)) {
#ifdef _DEBUG
printf("Could not reset device gamma\n");
#endif
}
} catch (...) {
printf("Exception occurred in SetDeviceGammaRamp\n");
}
ReleaseDC(NULL, screenDC);
if (modeSet) {
@ -296,11 +300,15 @@ JNIEXPORT void JNICALL Java_org_lwjgl_Display_resetDisplayMode
void tempResetDisplayMode() {
// Return device gamma to normal
HDC screenDC = GetDC(NULL);
if (!SetDeviceGammaRamp(screenDC, originalGamma)) {
#ifdef _DEBUG
printf("Could not reset device gamma\n");
#endif
}
try {
if (!SetDeviceGammaRamp(screenDC, originalGamma)) {
#ifdef _DEBUG
printf("Could not reset device gamma\n");
#endif
}
} catch (...) {
printf("Exception occurred in SetDeviceGammaRamp\n");
}
ReleaseDC(NULL, screenDC);
if (modeSet) {
@ -319,11 +327,15 @@ void tempResetDisplayMode() {
void tempRestoreDisplayMode() {
// Restore gamma
HDC screenDC = GetDC(NULL);
if (!SetDeviceGammaRamp(screenDC, currentGamma)) {
#ifdef _DEBUG
printf("Could not restore device gamma\n");
#endif
}
try {
if (!SetDeviceGammaRamp(screenDC, currentGamma)) {
#ifdef _DEBUG
printf("Could not restore device gamma\n");
#endif
}
} catch (...) {
printf("Exception occurred in SetDeviceGammaRamp\n");
}
ReleaseDC(NULL, screenDC);
if (!modeSet) {
@ -374,13 +386,18 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_Display_setGammaRamp
}
jboolean ret;
HDC screenDC = GetDC(NULL);
if (SetDeviceGammaRamp(screenDC, currentGamma) == FALSE) {
#ifdef _DEBUG
printf("Failed to set device gamma\n");
#endif
try {
if (SetDeviceGammaRamp(screenDC, currentGamma) == FALSE) {
#ifdef _DEBUG
printf("Failed to set device gamma\n");
#endif
ret = JNI_FALSE;
} else {
ret = JNI_TRUE;
}
} catch (...) {
printf("Exception occurred in SetDeviceGammaRamp\n");
ret = JNI_FALSE;
} else {
ret = JNI_TRUE;
}
ReleaseDC(NULL, screenDC);
@ -419,10 +436,14 @@ JNIEXPORT void JNICALL Java_org_lwjgl_Display_init
env->DeleteLocalRef(newMode);
// Get the default gamma ramp
if (GetDeviceGammaRamp(screenDC, originalGamma) == FALSE) {
#ifdef _DEBUG
printf("Failed to get initial device gamma\n");
#endif
try {
if (GetDeviceGammaRamp(screenDC, originalGamma) == FALSE) {
#ifdef _DEBUG
printf("Failed to get initial device gamma\n");
#endif
}
} catch (...) {
printf("Exception occurred in GetDeviceGammaRamp\n");
}
ReleaseDC(NULL, screenDC);
}

View File

@ -141,3 +141,15 @@ JNIEXPORT void JNICALL Java_org_lwjgl_Sys_alert
env->ReleaseStringUTFChars(message, eMessageText);
env->ReleaseStringUTFChars(title, cTitleBarText);
}
// Cas: I've left this here as sometimes it's handy to just pop it back in to debug stuff
/*
* Class: org_lwjgl_Sys
* Method: getDirectBufferAddress
* Signature: (Ljava/nio/Buffer;)I
JNIEXPORT jint JNICALL Java_org_lwjgl_Sys_getDirectBufferAddress
(JNIEnv * env, jclass clazz, jobject buf)
{
return (jint) env->GetDirectBufferAddress(buf);
}
*/