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
impl ViewportState
sourcepub fn new() -> Self
👎Deprecated since 0.34.0
pub fn new() -> Self
Creates a ViewportState
with fixed state and no viewports or scissors.
sourcepub fn viewport_fixed_scissor_fixed(
data: impl IntoIterator<Item = (Viewport, Scissor)>
) -> Self
👎Deprecated since 0.34.0
pub fn viewport_fixed_scissor_fixed( data: impl IntoIterator<Item = (Viewport, Scissor)> ) -> Self
Creates a ViewportState
with fixed state from the given viewports and scissors.
sourcepub fn viewport_fixed_scissor_irrelevant(
data: impl IntoIterator<Item = Viewport>
) -> Self
👎Deprecated since 0.34.0
pub fn viewport_fixed_scissor_irrelevant( data: impl IntoIterator<Item = Viewport> ) -> Self
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
impl Clone for ViewportState
source§fn clone(&self) -> ViewportState
fn clone(&self) -> ViewportState
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more