ソースを参照

cocoa: Support EDR windows with float framebuffer

Requires macOS 10.11
rdb 2 年 前
コミット
20a2b26090

+ 5 - 0
panda/src/cocoadisplay/cocoaGraphicsWindow.mm

@@ -449,6 +449,11 @@ open_window() {
     _parent_window_handle->attach_child(_window_handle);
     _parent_window_handle->attach_child(_window_handle);
   }
   }
 
 
+  if (_fb_properties.get_float_color() &&
+      [_view respondsToSelector:@selector(setWantsExtendedDynamicRangeOpenGLSurface:)]) {
+    [_view setWantsExtendedDynamicRangeOpenGLSurface:YES];
+  }
+
   // Configure the view to be high resolution capable using the dpi-aware
   // Configure the view to be high resolution capable using the dpi-aware
   // configuration flag. If dpi-aware is false, macOS will upscale the view
   // configuration flag. If dpi-aware is false, macOS will upscale the view
   // for us.
   // for us.

+ 4 - 0
panda/src/cocoagldisplay/cocoaGLGraphicsStateGuardian.mm

@@ -188,6 +188,10 @@ choose_pixel_format(const FrameBufferProperties &properties,
   attribs.push_back(NSOpenGLPFAColorSize);
   attribs.push_back(NSOpenGLPFAColorSize);
   attribs.push_back(properties.get_color_bits());
   attribs.push_back(properties.get_color_bits());
 
 
+  if (properties.get_float_color()) {
+    attribs.push_back(NSOpenGLPFAColorFloat);
+  }
+
   // Set the depth buffer bits to 24 manually when 1 is requested.
   // Set the depth buffer bits to 24 manually when 1 is requested.
   // This prevents getting a depth buffer of only 16 bits when requesting 1.
   // This prevents getting a depth buffer of only 16 bits when requesting 1.
   attribs.push_back(NSOpenGLPFADepthSize);
   attribs.push_back(NSOpenGLPFADepthSize);