Add support for sRGB attribute and fix creation on windows

This commit is contained in:
Pierre Krieger 2015-04-03 14:02:33 +02:00
parent 41044c160a
commit 65f4809280
4 changed files with 41 additions and 1 deletions

View file

@ -253,6 +253,7 @@ pub struct BuilderAttribs<'a> {
color_bits: Option<u8>,
alpha_bits: Option<u8>,
stereoscopy: bool,
srgb: Option<bool>,
}
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));