pub struct Viewport {
pub offset: [f32; 2],
pub extent: [f32; 2],
pub depth_range: RangeInclusive<f32>,
}
Expand description
State of a single viewport.
Fields§
§offset: [f32; 2]
Coordinates in pixels of the top-left hand corner of the viewport.
The default value is [0.0; 2]
.
extent: [f32; 2]
Dimensions in pixels of the viewport.
The default value is [1.0; 2]
, which you probably want to override if you are not
using dynamic state.
depth_range: RangeInclusive<f32>
Minimum and maximum values of the depth.
The values 0.0
to 1.0
of each vertex’s Z coordinate will be mapped to this
depth_range
before being compared to the existing depth value.
This is equivalents to glDepthRange
in OpenGL, except that OpenGL uses the Z coordinate
range from -1.0
to 1.0
instead.
The default value is 0.0..=1.0
.
Trait Implementations§
source§impl PartialEq for Viewport
impl PartialEq for Viewport
impl StructuralPartialEq for Viewport
Auto Trait Implementations§
impl RefUnwindSafe for Viewport
impl Send for Viewport
impl Sync for Viewport
impl Unpin 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