mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-11 21:31:29 +11: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:
commit
4ecddabe08
|
@ -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)
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue