pub trait GlConfig: Sealed {
// Required methods
fn color_buffer_type(&self) -> Option<ColorBufferType>;
fn float_pixels(&self) -> bool;
fn alpha_size(&self) -> u8;
fn depth_size(&self) -> u8;
fn stencil_size(&self) -> u8;
fn num_samples(&self) -> u8;
fn srgb_capable(&self) -> bool;
fn supports_transparency(&self) -> Option<bool>;
fn hardware_accelerated(&self) -> bool;
fn config_surface_types(&self) -> ConfigSurfaceTypes;
fn api(&self) -> Api;
}
Expand description
The trait to group all common config option.
Required Methods§
Sourcefn color_buffer_type(&self) -> Option<ColorBufferType>
fn color_buffer_type(&self) -> Option<ColorBufferType>
The type of the underlying color buffer.
None
is returned when the format can not be identified.
Sourcefn float_pixels(&self) -> bool
fn float_pixels(&self) -> bool
Whether the config uses floating pixels.
Sourcefn alpha_size(&self) -> u8
fn alpha_size(&self) -> u8
The size of the alpha.
Sourcefn depth_size(&self) -> u8
fn depth_size(&self) -> u8
The size of the depth buffer.
Sourcefn stencil_size(&self) -> u8
fn stencil_size(&self) -> u8
The size of the stencil buffer.
Sourcefn num_samples(&self) -> u8
fn num_samples(&self) -> u8
The number of samples in multisample buffer.
Zero would mean that there’re no samples.
Sourcefn srgb_capable(&self) -> bool
fn srgb_capable(&self) -> bool
Whether the config supports creating srgb capable Surface
.
Sourcefn supports_transparency(&self) -> Option<bool>
fn supports_transparency(&self) -> Option<bool>
Whether the config supports creating transparent surfaces.
This function will return None
when the property couldn’t be
identified, in that case transparent window could still work.
Sourcefn hardware_accelerated(&self) -> bool
fn hardware_accelerated(&self) -> bool
Whether the config is hardware accelerated.
The meaning of this may vary from system to system. On some it could mean that you’re using a software backend renderer, it could mean that you’re using not the fastest available GPU, like in laptops with hybrid graphics.
Sourcefn config_surface_types(&self) -> ConfigSurfaceTypes
fn config_surface_types(&self) -> ConfigSurfaceTypes
The type of the surfaces that can be created with this config.
Sourcefn api(&self) -> Api
fn api(&self) -> Api
The crate::config::Api
supported by the configuration.