Mac OS X: Add error handling to gamma functions
This commit is contained in:
parent
cea73a6b85
commit
4ce552b44b
|
@ -169,7 +169,10 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_restoreGamma(JNIEnv *
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_setGammaRamp(JNIEnv *env, jobject this, jobject gamma_buffer) {
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_setGammaRamp(JNIEnv *env, jobject this, jobject gamma_buffer) {
|
||||||
const CGGammaValue *values = (*env)->GetDirectBufferAddress(env, gamma_buffer);
|
const CGGammaValue *values = (*env)->GetDirectBufferAddress(env, gamma_buffer);
|
||||||
CGTableCount table_size = (*env)->GetDirectBufferCapacity(env, gamma_buffer);
|
CGTableCount table_size = (*env)->GetDirectBufferCapacity(env, gamma_buffer);
|
||||||
CGSetDisplayTransferByTable(kCGDirectMainDisplay, table_size, values, values, values);
|
CGDisplayErr err = CGSetDisplayTransferByTable(kCGDirectMainDisplay, table_size, values, values, values);
|
||||||
|
if (err != CGDisplayNoErr) {
|
||||||
|
throwException(env, "Could not set display gamma");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_hideUI(JNIEnv *env, jobject this, jboolean hide) {
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_hideUI(JNIEnv *env, jobject this, jboolean hide) {
|
||||||
|
|
Loading…
Reference in New Issue