From 230db88fb2d9454eb13bc4e260723f57f6c4dabe Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 15 Dec 2021 02:07:13 -0300 Subject: Add setting to try OpenGL ES first --- src/settings.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/settings.rs b/src/settings.rs index f7940a0b..c521a62a 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -55,6 +55,15 @@ pub struct Settings { /// /// [`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 Settings { @@ -73,6 +82,7 @@ impl Settings { 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 From> for iced_winit::Settings { window: settings.window.into(), flags: settings.flags, exit_on_close_request: settings.exit_on_close_request, + try_opengles_first: settings.try_opengles_first, } } } -- cgit