Fix missing parameter for pixel formats infos on win32

This commit is contained in:
Pierre Krieger 2015-04-02 13:53:15 +02:00
parent 2e1fe8283f
commit 4d81cc2df1
3 changed files with 16 additions and 6 deletions

View file

@ -29,6 +29,7 @@ fn main() {
"WGL_ARB_create_context_profile".to_string(), "WGL_ARB_create_context_profile".to_string(),
"WGL_ARB_extensions_string".to_string(), "WGL_ARB_extensions_string".to_string(),
"WGL_ARB_framebuffer_sRGB".to_string(), "WGL_ARB_framebuffer_sRGB".to_string(),
"WGL_ARB_multisample".to_string(),
"WGL_ARB_pixel_format".to_string(), "WGL_ARB_pixel_format".to_string(),
"WGL_EXT_create_context_es2_profile".to_string(), "WGL_EXT_create_context_es2_profile".to_string(),
"WGL_EXT_extensions_string".to_string(), "WGL_EXT_extensions_string".to_string(),

View file

@ -332,10 +332,6 @@ impl<'a> BuilderAttribs<'a> {
continue; continue;
} }
if self.multisampling.is_some() && format.multisampling.is_none() {
continue;
}
current_software_result = Some((id.clone(), format.clone())); current_software_result = Some((id.clone(), format.clone()));
if format.hardware_accelerated { if format.hardware_accelerated {
current_result = Some((id, format)); current_result = Some((id, format));

View file

@ -491,8 +491,21 @@ unsafe fn enumerate_arb_pixel_formats(extra: &gl::wgl_extra::Wgl, hdc: &WindowWr
stencil_bits: get_info(index, gl::wgl_extra::STENCIL_BITS_ARB) as u8, stencil_bits: get_info(index, gl::wgl_extra::STENCIL_BITS_ARB) as u8,
stereoscopy: get_info(index, gl::wgl_extra::STEREO_ARB) != 0, stereoscopy: get_info(index, gl::wgl_extra::STEREO_ARB) != 0,
double_buffer: get_info(index, gl::wgl_extra::DOUBLE_BUFFER_ARB) != 0, double_buffer: get_info(index, gl::wgl_extra::DOUBLE_BUFFER_ARB) != 0,
multisampling: None, // FIXME: multisampling: {
srgb: false, // FIXME: if is_extension_supported(extra, hdc, "WGL_ARB_multisample") {
match get_info(index, gl::wgl_extra::SAMPLES_ARB) {
0 => None,
a => Some(a as u16),
}
} else {
None
}
},
srgb: if is_extension_supported(extra, hdc, "WGL_ARB_framebuffer_sRGB") {
get_info(index, gl::wgl_extra::FRAMEBUFFER_SRGB_CAPABLE_ARB) != 0
} else {
false
},
}, index as libc::c_int)); }, index as libc::c_int));
} }