From 65f4809280b9b85bb55cfc7b72274fb56e094b4d Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Fri, 3 Apr 2015 14:02:33 +0200 Subject: Add support for sRGB attribute and fix creation on windows --- src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 4de2f44..d830f58 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -253,6 +253,7 @@ pub struct BuilderAttribs<'a> { color_bits: Option, alpha_bits: Option, stereoscopy: bool, + srgb: Option, } impl BuilderAttribs<'static> { @@ -274,6 +275,7 @@ impl BuilderAttribs<'static> { color_bits: None, alpha_bits: None, stereoscopy: false, + srgb: None, } } } @@ -299,6 +301,7 @@ impl<'a> BuilderAttribs<'a> { color_bits: self.color_bits, alpha_bits: self.alpha_bits, stereoscopy: self.stereoscopy, + srgb: self.srgb, }; (new_attribs, sharing) @@ -332,6 +335,16 @@ impl<'a> BuilderAttribs<'a> { continue; } + if self.multisampling.is_some() && format.multisampling.is_none() { + continue; + } + + if let Some(srgb) = self.srgb { + if srgb != format.srgb { + continue; + } + } + current_software_result = Some((id.clone(), format.clone())); if format.hardware_accelerated { current_result = Some((id, format)); -- cgit v1.2.3