diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2015-04-29 17:56:55 +0200 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2015-04-29 17:56:55 +0200 |
commit | 4ecddabe08fa585d686793f632a4ff748f48b25a (patch) | |
tree | d4701b839f404de8ef92d7290e98409790c762d0 | |
parent | c752142e045156c6869a43183032030dd1d0439d (diff) | |
parent | 9ed1a0ec19388641a3df99ce6689b38ab87ddfec (diff) | |
download | glutin-4ecddabe08fa585d686793f632a4ff748f48b25a.tar.gz glutin-4ecddabe08fa585d686793f632a4ff748f48b25a.zip |
Merge pull request #406 from tomaka/fallback-win32-pixelformats
Add a fallback on win32 if enumerate_arb_pixel_formats returns vec![]
-rw-r--r-- | src/api/win32/init.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/api/win32/init.rs b/src/api/win32/init.rs index 5cdd6b8..a9d77d1 100644 --- a/src/api/win32/init.rs +++ b/src/api/win32/init.rs @@ -205,7 +205,12 @@ 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) + let f = enumerate_arb_pixel_formats(&extra_functions, &real_window); + if f.is_empty() { + enumerate_native_pixel_formats(&real_window) + } else { + f + } } else { enumerate_native_pixel_formats(&real_window) }; |