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_attributes(
self,
window_attributes: Option<WindowAttributes>,
) -> Self
pub fn with_window_attributes( self, window_attributes: Option<WindowAttributes>, ) -> Self
The window attributes to use when building a window.
By default no window is created.
sourcepub fn build<Picker>(
self,
event_loop: &impl GlutinEventLoop,
template_builder: ConfigTemplateBuilder,
config_picker: Picker,
) -> Result<(Option<Window>, Config), Box<dyn Error>>
pub fn build<Picker>( self, event_loop: &impl GlutinEventLoop, 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 WindowAttributes
was passed with
Self::with_window_attributes()
. 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
WindowAttributes
.
§Api-specific
WGL: - WindowAttributes
must be passed in
Self::with_window_attributes()
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 moresource§impl Debug for DisplayBuilder
impl Debug for DisplayBuilder
source§impl Default for DisplayBuilder
impl Default for DisplayBuilder
source§fn default() -> DisplayBuilder
fn default() -> DisplayBuilder
Auto Trait Implementations§
impl Freeze for DisplayBuilder
impl !RefUnwindSafe for DisplayBuilder
impl Send for DisplayBuilder
impl Sync for DisplayBuilder
impl Unpin for DisplayBuilder
impl !UnwindSafe for DisplayBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.