pub struct ViewportDescriptor { /* private fields */ }Expand description
Describes a 2D viewport rectangle plus optional depth range, in the same pixel space as the destination render target.
Used by WebGpuRenderer::set_viewport (and any future caller that needs
to push a GpuViewport-shaped JS object through Reflect::set). The
depth-range fields are omitted from the ::new constructor via
#[new(skip)]; they default to zero-initialised f32 and are typically
overwritten by WebGpuRenderer::set_viewport to the WebGPU spec
defaults of 0.0 / 1.0.
Implementations§
Source§impl ViewportDescriptor
impl ViewportDescriptor
pub fn get_x(&self) -> &f32
pub fn get_mut_x(&mut self) -> &mut f32
pub fn set_x(&mut self, val: f32) -> &mut Self
pub fn get_y(&self) -> &f32
pub fn get_mut_y(&mut self) -> &mut f32
pub fn set_y(&mut self, val: f32) -> &mut Self
pub fn get_width(&self) -> &f32
pub fn get_mut_width(&mut self) -> &mut f32
pub fn set_width(&mut self, val: f32) -> &mut Self
pub fn get_height(&self) -> &f32
pub fn get_mut_height(&mut self) -> &mut f32
pub fn set_height(&mut self, val: f32) -> &mut Self
pub fn get_min_depth(&self) -> &f32
pub fn get_mut_min_depth(&mut self) -> &mut f32
pub fn set_min_depth(&mut self, val: f32) -> &mut Self
pub fn get_max_depth(&self) -> &f32
pub fn get_mut_max_depth(&mut self) -> &mut f32
pub fn set_max_depth(&mut self, val: f32) -> &mut Self
Trait Implementations§
Source§impl Clone for ViewportDescriptor
impl Clone for ViewportDescriptor
Source§fn clone(&self) -> ViewportDescriptor
fn clone(&self) -> ViewportDescriptor
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 moreimpl Copy for ViewportDescriptor
Source§impl Debug for ViewportDescriptor
impl Debug for ViewportDescriptor
Source§impl PartialEq for ViewportDescriptor
impl PartialEq for ViewportDescriptor
impl StructuralPartialEq for ViewportDescriptor
Auto Trait Implementations§
impl Freeze for ViewportDescriptor
impl RefUnwindSafe for ViewportDescriptor
impl Send for ViewportDescriptor
impl Sync for ViewportDescriptor
impl Unpin for ViewportDescriptor
impl UnsafeUnpin for ViewportDescriptor
impl UnwindSafe for ViewportDescriptor
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