*** 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); 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: LIBRARY_NAME */
/* Inaccessible static: DEBUG */ /* Inaccessible static: DEBUG */
/* Inaccessible static: _debug */ /* Inaccessible static: _debug */
/* Inaccessible static: class_00024org_00024lwjgl_00024Sys */ /* Inaccessible static: class_000240 */
/* /*
* Class: org_lwjgl_Sys * Class: org_lwjgl_Sys
* Method: getTimerResolution * Method: getTimerResolution
@ -60,6 +60,14 @@ JNIEXPORT void JNICALL Java_org_lwjgl_Sys_setProcessPriority
JNIEXPORT void JNICALL Java_org_lwjgl_Sys_alert JNIEXPORT void JNICALL Java_org_lwjgl_Sys_alert
(JNIEnv *, jclass, jstring, jstring); (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 #ifdef __cplusplus
} }
#endif #endif

View File

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

View File

@ -141,3 +141,15 @@ JNIEXPORT void JNICALL Java_org_lwjgl_Sys_alert
env->ReleaseStringUTFChars(message, eMessageText); env->ReleaseStringUTFChars(message, eMessageText);
env->ReleaseStringUTFChars(title, cTitleBarText); 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);
}
*/