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