pub struct Viewport {
pub x: u32,
pub y: u32,
pub width: u32,
pub height: u32,
}Expand description
Pixel rectangle, origin top-left, +y down.
Fields§
§x: u32§y: u32§width: u32§height: u32Implementations§
Source§impl Viewport
impl Viewport
pub fn full(framebuffer: [u32; 2]) -> Self
Sourcepub fn right_of_left_panel(panel_width: u32, framebuffer: [u32; 2]) -> Self
pub fn right_of_left_panel(panel_width: u32, framebuffer: [u32; 2]) -> Self
Empty when the panel covers the framebuffer.
pub fn apply(&self, rp: &mut RenderPass<'_>)
pub fn resolution_f32(&self) -> [f32; 2]
Sourcepub fn split_horizontal(&self, n: u32) -> impl Iterator<Item = Viewport>
pub fn split_horizontal(&self, n: u32) -> impl Iterator<Item = Viewport>
The last cell absorbs the rounding remainder; empty when n == 0.
pub fn split_vertical(&self, n: u32) -> impl Iterator<Item = Viewport>
Trait Implementations§
impl Copy for Viewport
impl Eq for Viewport
impl StructuralPartialEq for Viewport
Auto Trait Implementations§
impl Freeze for Viewport
impl RefUnwindSafe for Viewport
impl Send for Viewport
impl Sync for Viewport
impl Unpin for Viewport
impl UnsafeUnpin for Viewport
impl UnwindSafe for Viewport
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more