aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/win32
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/win32')
-rw-r--r--src/api/win32/init.rs7
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)
};