Struct glutin_winit::DisplayBuilder
source · pub struct DisplayBuilder { /* private fields */ }
Expand description
The helper to perform Display
creation and OpenGL platform
bootstrapping with the help of winit
with little to no platform specific
code.
This is only required for the initial setup. If you want to create
additional windows just use the finalize_window
function and the
configuration you’ve used either for the original window or picked with the
existing Display
.
Implementations§
source§impl DisplayBuilder
impl DisplayBuilder
sourcepub fn with_preference(self, preference: ApiPreference) -> Self
pub fn with_preference(self, preference: ApiPreference) -> Self
The preference in picking the configuration.
sourcepub fn with_window_builder(self, window_builder: Option<WindowBuilder>) -> Self
pub fn with_window_builder(self, window_builder: Option<WindowBuilder>) -> Self
The window builder to use when building a window.
By default no window is created.
sourcepub fn build<T, Picker>(
self,
window_target: &EventLoopWindowTarget<T>,
template_builder: ConfigTemplateBuilder,
config_picker: Picker
) -> Result<(Option<Window>, Config), Box<dyn Error>>
pub fn build<T, Picker>( self, window_target: &EventLoopWindowTarget<T>, template_builder: ConfigTemplateBuilder, config_picker: Picker ) -> Result<(Option<Window>, Config), Box<dyn Error>>
Initialize the OpenGL platform and create a compatible window to use
with it when the WindowBuilder
was passed with
Self::with_window_builder
. It’s optional, since on some
platforms like Android
it is not available early on, so you want to
find configuration and later use it with the finalize_window
.
But if you don’t care about such platform you can always pass
WindowBuilder
.
Api-specific
WGL: - WindowBuilder
must be passed in
Self::with_window_builder
if modern OpenGL(ES) is desired,
otherwise only builtin functions like glClear
will be available.
Trait Implementations§
source§impl Clone for DisplayBuilder
impl Clone for DisplayBuilder
source§fn clone(&self) -> DisplayBuilder
fn clone(&self) -> DisplayBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more