Struct grr::Viewport

source ·
pub struct Viewport {
    pub x: f32,
    pub y: f32,
    pub w: f32,
    pub h: f32,
    pub n: f64,
    pub f: f64,
}
Expand description

Viewport transformation.

Viewport transformation is part of the fixed-function Vertex Post-Processing pipeline. The returning vertex positions (GLSL: gl_Position) in clip space are transformed to normalized device coordinates (NDC) by perspective division. Viewport transformation further converts the NDC into framebuffer coordinates.

During the geometry a primitive will be assigned a viewport index (GLSL: gl_ViewportIndex) either automatically or manually. This index controls which viewport from the bounded viewports will be selected for applying the transformation for the current primitive.

Fields

x: f32

Offset (x).

y: f32

Offset (y).

w: f32

Width.

h: f32

Height.

n: f64f: f64

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.