Browse Source

cocoa: cautiously enable sRGB framebuffers on macOS

[skip ci]
rdb 7 years ago
parent
commit
ed96a52703
1 changed files with 6 additions and 0 deletions
  1. 6 0
      panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm

+ 6 - 0
panda/src/cocoadisplay/cocoaGraphicsStateGuardian.mm

@@ -134,6 +134,12 @@ get_properties(FrameBufferProperties &properties, NSOpenGLPixelFormat* pixel_for
   if (accelerated) {
     properties.set_force_hardware(1);
   }
+
+  // Cautiously setting this to true.  It appears that macOS framebuffers are
+  // sRGB-capable, but I don't really know how to verify this.
+  if (color_size == 32 && !color_float) {
+    properties.set_srgb_color(true);
+  }
 }
 
 /**