aboutsummaryrefslogtreecommitdiffstats
path: root/src/api
diff options
context:
space:
mode:
authorPierre Chevalier <pierrechevalier83@hotmail.fr>2016-04-13 01:13:56 +0100
committerPierre Chevalier <pierrechevalier83@hotmail.fr>2016-04-13 01:25:23 +0100
commitc68c0d96b25d01571b131bdd53a61407b0405558 (patch)
treebf5f46e6acebaf16fdc64ac24270a5d1e149b12c /src/api
parentce03ade47ce70824bdc58d61f566378c858223b5 (diff)
downloadglutin-c68c0d96b25d01571b131bdd53a61407b0405558.tar.gz
glutin-c68c0d96b25d01571b131bdd53a61407b0405558.zip
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
Diffstat (limited to 'src/api')
-rw-r--r--src/api/glx/mod.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/api/glx/mod.rs b/src/api/glx/mod.rs
index 317d9ff..18f2938 100644
--- a/src/api/glx/mod.rs
+++ b/src/api/glx/mod.rs
@@ -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() {
out.push(ffi::glx_extra::FRAMEBUFFER_SRGB_CAPABLE_ARB as c_int);
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 {
return Err(());
}
@@ -498,7 +501,8 @@ unsafe fn choose_fbconfig(glx: &ffi::glx::Glx, extensions: &str, xlib: &ffi::Xli
} else {
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))