Take into account the original gamma before applying gamma.

This commit is contained in:
Tai Chi Minh Ralph Eastwood
2011-09-14 06:53:26 +01:00
parent 688772111d
commit 53f64983a9
3 changed files with 57 additions and 17 deletions
+8 -1
View File
@@ -225,6 +225,10 @@ int _glfwPlatformInit(void)
_glfwLibrary.NS.desktopMode =
(NSDictionary*) CGDisplayCurrentMode(CGMainDisplayID());
// Save the original gamma ramp
_glfwLibrary.originalRampSize = CGDisplayGammaTableCapacity(CGMainDisplayID());
_glfwPlatformGetGammaRamp(&_glfwLibrary.originalRamp);
return GL_TRUE;
}
@@ -235,7 +239,10 @@ int _glfwPlatformInit(void)
int _glfwPlatformTerminate(void)
{
// TODO: Probably other cleanup
// Restore the original gamma ramp
_glfwPlatformSetGammaRamp(&_glfwLibrary.originalRamp);
[NSApp setDelegate:nil];
[_glfwLibrary.NS.delegate release];
_glfwLibrary.NS.delegate = nil;