cocoa: Support EDR windows with float framebuffer

Requires macOS 10.11
This commit is contained in:
rdb 2023-10-23 12:17:09 +02:00
parent b7fa25f8f4
commit 20a2b26090
2 changed files with 9 additions and 0 deletions

View File

@ -449,6 +449,11 @@ open_window() {
_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
// configuration flag. If dpi-aware is false, macOS will upscale the view
// for us.

View File

@ -188,6 +188,10 @@ choose_pixel_format(const FrameBufferProperties &properties,
attribs.push_back(NSOpenGLPFAColorSize);
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.
// This prevents getting a depth buffer of only 16 bits when requesting 1.
attribs.push_back(NSOpenGLPFADepthSize);