choose_pixel_format now returns a Result

This commit is contained in:
Pierre Krieger 2015-03-26 19:07:59 +01:00
parent d7c44b95b0
commit 697d42a64f
2 changed files with 4 additions and 4 deletions

View file

@ -136,7 +136,7 @@ unsafe fn init(title: Vec<u16>, builder: BuilderAttribs<'static>,
// getting the pixel format that we will use and setting it
{
let formats = enumerate_native_pixel_formats(&dummy_window);
let (id, _) = builder.choose_pixel_format(formats.into_iter().map(|(a, b)| (b, a)));
let (id, _) = try!(builder.choose_pixel_format(formats.into_iter().map(|(a, b)| (b, a))));
try!(set_pixel_format(&dummy_window, id));
}
@ -206,7 +206,7 @@ unsafe fn init(title: Vec<u16>, builder: BuilderAttribs<'static>,
enumerate_native_pixel_formats(&real_window)
};
let (id, _) = builder.choose_pixel_format(formats.into_iter().map(|(a, b)| (b, a)));
let (id, _) = try!(builder.choose_pixel_format(formats.into_iter().map(|(a, b)| (b, a))));
try!(set_pixel_format(&real_window, id));
}