From 9ed1a0ec19388641a3df99ce6689b38ab87ddfec Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 29 Apr 2015 14:17:51 +0200 Subject: Add a fallback on win32 if enumerate_arb_pixel_formats returns vec![] --- src/api/win32/init.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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, 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) }; -- cgit v1.2.3