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

source

pub fn new() -> Self

Create new display builder.

source

pub fn with_preference(self, preference: ApiPreference) -> Self

The preference in picking the configuration.

source

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.

source

pub fn build<T, Picker>( self, window_target: &EventLoopWindowTarget<T>, template_builder: ConfigTemplateBuilder, config_picker: Picker ) -> Result<(Option<Window>, Config), Box<dyn Error>>
where Picker: FnOnce(Box<dyn Iterator<Item = Config> + '_>) -> Config,

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

source§

fn clone(&self) -> DisplayBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DisplayBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for DisplayBuilder

source§

fn default() -> DisplayBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.