pub struct ConfigTemplateBuilder { /* private fields */ }
Expand description

Builder for the ConfigTemplate.

Implementations§

source§

impl ConfigTemplateBuilder

source

pub fn new() -> Self

Create a new configuration template builder.

source

pub fn with_alpha_size(self, alpha_size: u8) -> Self

Number of alpha bits in the color buffer.

By default 8 is requested.

source

pub fn with_float_pixels(self, float_pixels: bool) -> Self

Wether the floating pixel formats should be used.

By default false is requested.

source

pub fn with_stencil_size(self, stencil_size: u8) -> Self

Number of bits in the stencil buffer.

By default 0 is requested.

source

pub fn with_depth_size(self, depth_size: u8) -> Self

Number of bits in the depth buffer.

By default 0 is requested.

source

pub fn with_multisampling(self, num_samples: u8) -> Self

Whether multisampling configurations should be picked. The num_samples must be a power of two.

By default multisampling is not specified.

source

pub fn with_surface_type(self, config_surface_types: ConfigSurfaceTypes) -> Self

The types of the surfaces that must be supported by the configuration.

By default only the WINDOW bit is set.

source

pub fn with_buffer_type(self, color_buffer_type: ColorBufferType) -> Self

The type of the color buffer.

By default RGB buffer with all components sizes of 8 is requested.

source

pub fn with_api(self, api: Api) -> Self

The set of apis that are supported by configuration.

By default api isn’t specified when requesting the configuration.

source

pub fn with_stereoscopy(self, stereoscopy: Option<bool>) -> Self

Wether the stereo pairs should be present.

By default it isn’t specified.

source

pub fn with_single_buffering(self, single_buffering: bool) -> Self

Wether the single buffer should be used.

By default false is requested.

source

pub fn with_transparency(self, transparency: bool) -> Self

Wether the configuration should support transparency.

The default is false.

Api-specific

EGL on X11 doesn’t provide a way to create a transparent surface at the time of writing. Use GLX for that instead.

source

pub fn with_pbuffer_sizes(self, width: NonZeroU32, height: NonZeroU32) -> Self

With the maximum sizes of pbuffer.

source

pub fn prefer_hardware_accelerated( self, hardware_accerelated: Option<bool> ) -> Self

Wether the configuration should prefer hardware accelerated formats or not.

By default hardware acceleration or its absence is not requested.

source

pub fn compatible_with_native_window( self, native_window: RawWindowHandle ) -> Self

Request config that can render to a particular native window.

Platform-specific

This will use native window when matching the config to get the best one suitable for rendering into that window.

When using WGL it’s the most reliable way to get a working configuration. With GLX it’ll use the visual passed in native_window to match the config.

source

pub fn with_swap_interval( self, min_swap_interval: Option<u16>, max_swap_interval: Option<u16> ) -> Self

With supported swap intervals.

By default the value isn’t specified.

Api-specific

Only supported with EGL.

source

pub fn build(self) -> ConfigTemplate

Build the template to match the configs against.

Trait Implementations§

source§

impl Clone for ConfigTemplateBuilder

source§

fn clone(&self) -> ConfigTemplateBuilder

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 ConfigTemplateBuilder

source§

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

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

impl Default for ConfigTemplateBuilder

source§

fn default() -> ConfigTemplateBuilder

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

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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 Twhere 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.