pub struct ViewportState {
    pub viewports: SmallVec<[Viewport; 1]>,
    pub scissors: SmallVec<[Scissor; 1]>,
    pub _ne: NonExhaustive,
}
Expand description

List of viewports and scissors that are used when creating a graphics pipeline object.

Note that the number of viewports and scissors must be the same.

Fields§

§viewports: SmallVec<[Viewport; 1]>

Specifies the viewport transforms.

When DynamicState::Viewport is used, the values of each viewport are ignored and must be set dynamically, but the number of viewports is fixed and must be matched when setting the dynamic value. When DynamicState::ViewportWithCount is used, the number of viewports is also dynamic, and viewports must be empty.

If neither the number of viewports nor the number of scissors is dynamic, then the number of both must be identical.

The default value is a single element of Viewport::default().

§scissors: SmallVec<[Scissor; 1]>

Specifies the scissor rectangles.

When DynamicState::Scissor is used, the values of each scissor are ignored and must be set dynamically, but the number of scissors is fixed and must be matched when setting the dynamic value. When DynamicState::ScissorWithCount is used, the number of scissors is also dynamic, and scissors must be empty.

If neither the number of viewports nor the number of scissors is dynamic, then the number of both must be identical.

The default value is a single element of Scissor::default().

§_ne: NonExhaustive

Implementations§

source§

impl ViewportState

source

pub fn new() -> Self

👎Deprecated since 0.34.0

Creates a ViewportState with fixed state and no viewports or scissors.

source

pub fn viewport_fixed_scissor_fixed( data: impl IntoIterator<Item = (Viewport, Scissor)> ) -> Self

👎Deprecated since 0.34.0

Creates a ViewportState with fixed state from the given viewports and scissors.

source

pub fn viewport_fixed_scissor_irrelevant( data: impl IntoIterator<Item = Viewport> ) -> Self

👎Deprecated since 0.34.0

Creates a ViewportState with fixed state from the given viewports, and matching scissors that cover the whole viewport.

Trait Implementations§

source§

impl Clone for ViewportState

source§

fn clone(&self) -> ViewportState

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ViewportState

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ViewportState

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.