mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 17:35:34 -04:00
cocoa: guarantee 24bit depth when Config.prc has depth-bits
set to 1
Checks if the value of Config.prc for `depth-bits` is `1` and sets it manually to 24. This prevents getting a 16 bit depth buffer on macos Intended to address #501 Closes #551
This commit is contained in:
parent
666568a513
commit
96bb90b5e9
@ -248,8 +248,17 @@ choose_pixel_format(const FrameBufferProperties &properties,
|
||||
attribs.push_back(aux_buffers);
|
||||
attribs.push_back(NSOpenGLPFAColorSize);
|
||||
attribs.push_back(properties.get_color_bits());
|
||||
|
||||
// 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);
|
||||
attribs.push_back(properties.get_depth_bits());
|
||||
if (properties.get_depth_bits() == 1) {
|
||||
attribs.push_back(24);
|
||||
}
|
||||
else {
|
||||
attribs.push_back(properties.get_depth_bits());
|
||||
}
|
||||
|
||||
attribs.push_back(NSOpenGLPFAStencilSize);
|
||||
attribs.push_back(properties.get_stencil_bits());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user