pub struct ConfigTemplateBuilder { /* private fields */ }
Expand description
Builder for the ConfigTemplate
.
Implementations§
Source§impl ConfigTemplateBuilder
impl ConfigTemplateBuilder
Sourcepub fn with_alpha_size(self, alpha_size: u8) -> Self
pub fn with_alpha_size(self, alpha_size: u8) -> Self
Number of alpha bits in the color buffer.
By default 8
is requested.
Sourcepub fn with_float_pixels(self, float_pixels: bool) -> Self
pub fn with_float_pixels(self, float_pixels: bool) -> Self
Whether the floating pixel formats should be used.
By default false
is requested.
Sourcepub fn with_stencil_size(self, stencil_size: u8) -> Self
pub fn with_stencil_size(self, stencil_size: u8) -> Self
Number of bits in the stencil buffer.
By default 0
is requested.
Sourcepub fn with_depth_size(self, depth_size: u8) -> Self
pub fn with_depth_size(self, depth_size: u8) -> Self
Number of bits in the depth buffer.
By default 0
is requested.
Sourcepub fn with_multisampling(self, num_samples: u8) -> Self
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.
Sourcepub fn with_surface_type(self, config_surface_types: ConfigSurfaceTypes) -> Self
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.
Sourcepub fn with_buffer_type(self, color_buffer_type: ColorBufferType) -> Self
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.
Sourcepub fn with_api(self, api: Api) -> Self
pub fn with_api(self, api: Api) -> Self
The set of apis that are supported by this configuration.
The default Api
depends on the used graphics platform interface. If
you want to do config filtering based on the Api
yourself, use
Api::empty
.
§Api-specific
- EGL:
Api::GLES2
bit is set by default to avoid matchingApi::GLES1
configs; - GLX/WGL/CGL:
Api::OPENGL
is always present in the result.
Sourcepub fn with_stereoscopy(self, stereoscopy: Option<bool>) -> Self
pub fn with_stereoscopy(self, stereoscopy: Option<bool>) -> Self
Whether the stereo pairs should be present.
By default it isn’t specified.
Sourcepub fn with_single_buffering(self, single_buffering: bool) -> Self
pub fn with_single_buffering(self, single_buffering: bool) -> Self
Whether the single buffer should be used.
By default false
is requested.
Sourcepub fn with_transparency(self, transparency: bool) -> Self
pub fn with_transparency(self, transparency: bool) -> Self
Whether 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.
Sourcepub fn with_pbuffer_sizes(self, width: NonZeroU32, height: NonZeroU32) -> Self
pub fn with_pbuffer_sizes(self, width: NonZeroU32, height: NonZeroU32) -> Self
With the maximum sizes of pbuffer.
Sourcepub fn prefer_hardware_accelerated(
self,
hardware_accerelated: Option<bool>,
) -> Self
pub fn prefer_hardware_accelerated( self, hardware_accerelated: Option<bool>, ) -> Self
Whether the configuration should prefer hardware accelerated formats or not.
By default hardware acceleration or its absence is not requested.
Sourcepub fn compatible_with_native_window(
self,
native_window: RawWindowHandle,
) -> Self
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.
Sourcepub fn with_swap_interval(
self,
min_swap_interval: Option<u16>,
max_swap_interval: Option<u16>,
) -> Self
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
.
Sourcepub fn build(self) -> ConfigTemplate
pub fn build(self) -> ConfigTemplate
Build the template to match the configs against.
Trait Implementations§
Source§impl Clone for ConfigTemplateBuilder
impl Clone for ConfigTemplateBuilder
Source§fn clone(&self) -> ConfigTemplateBuilder
fn clone(&self) -> ConfigTemplateBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more