mirror of
https://github.com/rust-windowing/winit.git
synced 2026-09-02 14:50:04 -04:00
Merge pull request #406 from tomaka/fallback-win32-pixelformats
Add a fallback on win32 if enumerate_arb_pixel_formats returns vec![]
This commit is contained in:
@@ -205,7 +205,12 @@ unsafe fn init(title: Vec<u16>, builder: BuilderAttribs<'static>,
|
|||||||
// calling SetPixelFormat
|
// calling SetPixelFormat
|
||||||
let pixel_format = {
|
let pixel_format = {
|
||||||
let formats = if extra_functions.GetPixelFormatAttribivARB.is_loaded() {
|
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 {
|
} else {
|
||||||
enumerate_native_pixel_formats(&real_window)
|
enumerate_native_pixel_formats(&real_window)
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user