[][src]Struct nannou::vk::ViewportBuilder

pub struct ViewportBuilder {
    pub origin: Option<[f32; 2]>,
    pub depth_range: Option<Range<f32>>,
}

A builder struct that makes the process of building a Viewport more modular.

Fields

origin: Option<[f32; 2]>depth_range: Option<Range<f32>>

Methods

impl ViewportBuilder[src]

pub const DEFAULT_ORIGIN: [f32; 2][src]

pub const DEFAULT_DEPTH_RANGE: Range<f32>[src]

pub fn new() -> Self[src]

Begin building a new Viewport.

pub fn origin(self, origin: [f32; 2]) -> Self[src]

Coordinates in pixels of the top-left hand corner of the viewport.

By default this is ViewportDefault::DEFAULT_ORIGIN.

pub fn depth_range(self, range: Range<f32>) -> Self[src]

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.

By default this is ViewportDefault::DEFAULT_DEPTH_RANGE.

pub fn build(self, dimensions: [f32; 2]) -> Viewport[src]

Construct the viewport with its dimensions in pixels.

Trait Implementations

impl Default for ViewportBuilder[src]

impl Clone for ViewportBuilder[src]

impl PartialEq<ViewportBuilder> for ViewportBuilder[src]

impl Debug for ViewportBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Style for T where
    T: Any + Debug + PartialEq<T>, 
[src]

impl<T> Content for T[src]

impl<T> SafeBorrow<T> for T[src]

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

impl<T> SetParameter for T

impl<T> SetParameter for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,