Add setting to try OpenGL ES first
This commit is contained in:
parent
46fb27b104
commit
230db88fb2
3 changed files with 34 additions and 4 deletions
|
|
@ -55,6 +55,15 @@ pub struct Settings<Flags> {
|
|||
///
|
||||
/// [`Application`]: crate::Application
|
||||
pub exit_on_close_request: bool,
|
||||
|
||||
/// Whether the [`Application`] should try to build the context
|
||||
/// using OpenGL ES first then OpenGL.
|
||||
///
|
||||
/// By default, it is disabled.
|
||||
/// **Note:** Only works for the `glow` backend.
|
||||
///
|
||||
/// [`Application`]: crate::Application
|
||||
pub try_opengles_first: bool,
|
||||
}
|
||||
|
||||
impl<Flags> Settings<Flags> {
|
||||
|
|
@ -73,6 +82,7 @@ impl<Flags> Settings<Flags> {
|
|||
text_multithreading: default_settings.text_multithreading,
|
||||
antialiasing: default_settings.antialiasing,
|
||||
exit_on_close_request: default_settings.exit_on_close_request,
|
||||
try_opengles_first: default_settings.try_opengles_first,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -91,6 +101,7 @@ where
|
|||
text_multithreading: false,
|
||||
antialiasing: false,
|
||||
exit_on_close_request: true,
|
||||
try_opengles_first: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -103,6 +114,7 @@ impl<Flags> From<Settings<Flags>> for iced_winit::Settings<Flags> {
|
|||
window: settings.window.into(),
|
||||
flags: settings.flags,
|
||||
exit_on_close_request: settings.exit_on_close_request,
|
||||
try_opengles_first: settings.try_opengles_first,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue