|
@@ -387,11 +387,18 @@ describe_pixel_format(FrameBufferProperties &fb_props) {
|
|
|
// for atexit.
|
|
// for atexit.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
bool osxGraphicsStateGuardian::
|
|
bool osxGraphicsStateGuardian::
|
|
|
-static_set_gamma(float gamma) {
|
|
|
|
|
|
|
+static_set_gamma(bool restore, float gamma) {
|
|
|
bool set;
|
|
bool set;
|
|
|
- CGDisplayRestoreColorSyncSettings();
|
|
|
|
|
|
|
+
|
|
|
set = false;
|
|
set = false;
|
|
|
|
|
|
|
|
|
|
+ if (restore) {
|
|
|
|
|
+ CGDisplayRestoreColorSyncSettings();
|
|
|
|
|
+ set = true;
|
|
|
|
|
+ return set;
|
|
|
|
|
+ }
|
|
|
|
|
+ CGDisplayRestoreColorSyncSettings();
|
|
|
|
|
+
|
|
|
CGGammaValue gOriginalRedTable[ 256 ];
|
|
CGGammaValue gOriginalRedTable[ 256 ];
|
|
|
CGGammaValue gOriginalGreenTable[ 256 ];
|
|
CGGammaValue gOriginalGreenTable[ 256 ];
|
|
|
CGGammaValue gOriginalBlueTable[ 256 ];
|
|
CGGammaValue gOriginalBlueTable[ 256 ];
|
|
@@ -443,11 +450,21 @@ bool osxGraphicsStateGuardian::
|
|
|
set_gamma(float gamma) {
|
|
set_gamma(float gamma) {
|
|
|
bool set;
|
|
bool set;
|
|
|
|
|
|
|
|
- set = static_set_gamma(gamma);
|
|
|
|
|
|
|
+ set = static_set_gamma(false, gamma);
|
|
|
|
|
|
|
|
return set;
|
|
return set;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: osxGraphicsStateGuardian::restore_gamma
|
|
|
|
|
+// Access: Published
|
|
|
|
|
+// Description: Restore original gamma.
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+void osxGraphicsStateGuardian::
|
|
|
|
|
+restore_gamma() {
|
|
|
|
|
+ static_set_gamma(true, 1.0f);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: osxGraphicsStateGuardian::atexit_function
|
|
// Function: osxGraphicsStateGuardian::atexit_function
|
|
|
// Access: Public, Static
|
|
// Access: Public, Static
|
|
@@ -455,7 +472,7 @@ set_gamma(float gamma) {
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void osxGraphicsStateGuardian::
|
|
void osxGraphicsStateGuardian::
|
|
|
atexit_function(void) {
|
|
atexit_function(void) {
|
|
|
- static_set_gamma(1.0);
|
|
|
|
|
|
|
+ static_set_gamma(true, 1.0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|