mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 22:31:30 +11:00
Add a fallback on win32 if enumerate_arb_pixel_formats returns vec![]
This commit is contained in:
parent
c752142e04
commit
9ed1a0ec19
|
@ -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)
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue