pub struct SurfaceConfig {
pub width: u32,
pub height: u32,
pub scale_factor: f32,
pub format: SwapchainFormat,
pub present_mode: PresentMode,
pub refresh_rate: RefreshRate,
}Expand description
Configuration descriptor for a presentation surface and its swapchain.
Fields§
§width: u32§height: u32§scale_factor: f32§format: SwapchainFormat§present_mode: PresentMode§refresh_rate: RefreshRateImplementations§
Source§impl SurfaceConfig
impl SurfaceConfig
Sourcepub fn physical_width(&self) -> u32
pub fn physical_width(&self) -> u32
Physical width in backing store pixels: ⌈logical_width * scale_factor⌉.
Sourcepub fn physical_height(&self) -> u32
pub fn physical_height(&self) -> u32
Physical height in backing store pixels: ⌈logical_height * scale_factor⌉.
Sourcepub fn physical_size(&self) -> (u32, u32)
pub fn physical_size(&self) -> (u32, u32)
Physical dimensions as (width, height) tuple.
Sourcepub fn buffer_byte_size(&self) -> usize
pub fn buffer_byte_size(&self) -> usize
Total byte footprint for a single physical frame buffer at this configuration.
Trait Implementations§
Source§impl Clone for SurfaceConfig
impl Clone for SurfaceConfig
Source§fn clone(&self) -> SurfaceConfig
fn clone(&self) -> SurfaceConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SurfaceConfig
impl Debug for SurfaceConfig
Source§impl Default for SurfaceConfig
impl Default for SurfaceConfig
Source§fn default() -> SurfaceConfig
fn default() -> SurfaceConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Forget for SurfaceConfig
impl Freeze for SurfaceConfig
impl Move for SurfaceConfig
impl RefUnwindSafe for SurfaceConfig
impl Send for SurfaceConfig
impl Sync for SurfaceConfig
impl Unpin for SurfaceConfig
impl UnsafeUnpin for SurfaceConfig
impl UnwindSafe for SurfaceConfig
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
Mutably borrows from an owned value. Read more