Skip to content

Commit 92ca12d

Browse files
committed
Merge remote-tracking branch 'upstream/master' into 0.22maj
2 parents 1b35f2a + 356e6cb commit 92ca12d

File tree

2 files changed

+32
-22
lines changed

2 files changed

+32
-22
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
# Unreleased
22

3+
- Fixed attribute handling for sRGB in WGL.
4+
35
# Version 0.22.0-alpha1 (2019-06-21)
46

57
- Update winit dependency to 0.20.0-alpha1. See [winit's CHANGELOG](https://github.com/rust-windowing/winit/blob/master/CHANGELOG.md#0200-alpha-1) for more info.
68

9+
# Version 0.21.0 (2019-04-20)
10+
11+
- Bumped dependencies, fixed docs.
12+
13+
# Version 0.21.0-rc3 (2019-04-13)
14+
15+
- Bumped dependencies.
16+
717
# Version 0.21.0-rc2 (2019-04-08)
818

919
- **Breaking**: Removed `DisplayLost` variant to `ContextError`.

glutin/src/api/wgl/mod.rs

+22-22
Original file line numberDiff line numberDiff line change
@@ -701,28 +701,28 @@ unsafe fn choose_arb_pixel_format_id(
701701
out.push(gl::wgl_extra::STEREO_ARB as raw::c_int);
702702
out.push(if pf_reqs.stereoscopy { 1 } else { 0 });
703703

704-
if pf_reqs.srgb {
705-
if extensions
706-
.split(' ')
707-
.find(|&i| i == "WGL_ARB_framebuffer_sRGB")
708-
.is_some()
709-
{
710-
out.push(
711-
gl::wgl_extra::FRAMEBUFFER_SRGB_CAPABLE_ARB as raw::c_int,
712-
);
713-
out.push(1);
714-
} else if extensions
715-
.split(' ')
716-
.find(|&i| i == "WGL_EXT_framebuffer_sRGB")
717-
.is_some()
718-
{
719-
out.push(
720-
gl::wgl_extra::FRAMEBUFFER_SRGB_CAPABLE_EXT as raw::c_int,
721-
);
722-
out.push(1);
723-
} else {
724-
return Err(());
725-
}
704+
// WGL_*_FRAMEBUFFER_SRGB might be assumed to be true if not listed;
705+
// so it's best to list it out and set its value as necessary.
706+
if extensions
707+
.split(' ')
708+
.find(|&i| i == "WGL_ARB_framebuffer_sRGB")
709+
.is_some()
710+
{
711+
out.push(
712+
gl::wgl_extra::FRAMEBUFFER_SRGB_CAPABLE_ARB as raw::c_int,
713+
);
714+
out.push(pf_reqs.srgb as raw::c_int);
715+
} else if extensions
716+
.split(' ')
717+
.find(|&i| i == "WGL_EXT_framebuffer_sRGB")
718+
.is_some()
719+
{
720+
out.push(
721+
gl::wgl_extra::FRAMEBUFFER_SRGB_CAPABLE_EXT as raw::c_int,
722+
);
723+
out.push(pf_reqs.srgb as raw::c_int);
724+
} else if pf_reqs.srgb {
725+
return Err(());
726726
}
727727

728728
match pf_reqs.release_behavior {

0 commit comments

Comments
 (0)