diff options
Diffstat (limited to 'src/win32/init.rs')
-rw-r--r-- | src/win32/init.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/win32/init.rs b/src/win32/init.rs index 743508e..5cdd6b8 100644 --- a/src/win32/init.rs +++ b/src/win32/init.rs @@ -203,16 +203,17 @@ unsafe fn init(title: Vec<u16>, builder: BuilderAttribs<'static>, }; // calling SetPixelFormat - { + let pixel_format = { let formats = if extra_functions.GetPixelFormatAttribivARB.is_loaded() { enumerate_arb_pixel_formats(&extra_functions, &real_window) } else { enumerate_native_pixel_formats(&real_window) }; - let (id, _) = try!(builder.choose_pixel_format(formats.into_iter().map(|(a, b)| (b, a)))); + let (id, f) = try!(builder.choose_pixel_format(formats.into_iter().map(|(a, b)| (b, a)))); try!(set_pixel_format(&real_window, id)); - } + f + }; // creating the OpenGL context let context = try!(create_context(Some((&extra_functions, &builder)), &real_window, @@ -263,6 +264,7 @@ unsafe fn init(title: Vec<u16>, builder: BuilderAttribs<'static>, events_receiver: events_receiver, is_closed: AtomicBool::new(false), cursor_state: cursor_state, + pixel_format: pixel_format, }) } |