Fix pixel format support detection in glx. #748

* by accepting GLX_EXT_framebuffer_sRGB as a sRGB capable framebuffer
* the new behaviour matches the wgl codel
This commit is contained in:
Pierre Chevalier 2016-04-13 01:13:56 +01:00
parent ce03ade47c
commit c68c0d96b2

View file

@ -430,6 +430,9 @@ unsafe fn choose_fbconfig(glx: &ffi::glx::Glx, extensions: &str, xlib: &ffi::Xli
if extensions.split(' ').find(|&i| i == "GLX_ARB_framebuffer_sRGB").is_some() { if extensions.split(' ').find(|&i| i == "GLX_ARB_framebuffer_sRGB").is_some() {
out.push(ffi::glx_extra::FRAMEBUFFER_SRGB_CAPABLE_ARB as c_int); out.push(ffi::glx_extra::FRAMEBUFFER_SRGB_CAPABLE_ARB as c_int);
out.push(1); out.push(1);
} else if extensions.split(' ').find(|&i| i == "GLX_EXT_framebuffer_sRGB").is_some() {
out.push(ffi::glx_extra::FRAMEBUFFER_SRGB_CAPABLE_EXT as c_int);
out.push(1);
} else { } else {
return Err(()); return Err(());
} }
@ -498,7 +501,8 @@ unsafe fn choose_fbconfig(glx: &ffi::glx::Glx, extensions: &str, xlib: &ffi::Xli
} else { } else {
None None
}, },
srgb: get_attrib(ffi::glx_extra::FRAMEBUFFER_SRGB_CAPABLE_ARB as c_int) != 0, srgb: get_attrib(ffi::glx_extra::FRAMEBUFFER_SRGB_CAPABLE_ARB as c_int) != 0 ||
get_attrib(ffi::glx_extra::FRAMEBUFFER_SRGB_CAPABLE_EXT as c_int) != 0,
}; };
Ok((fb_config, pf_desc)) Ok((fb_config, pf_desc))