Struct gfx_gtk::Viewport [−][src]
pub struct Viewport { pub width: i32, pub height: i32, pub target_width: i32, pub target_height: i32, pub aa: AaMode, }
Describes the client area of the GlArea being rendered into
Fields
width: i32
Width of the render target in pixels. This may be larger than the actual client window size.
height: i32
Height of the render target in pixels. This may be larger than the actual client window size.
target_width: i32
Width of the GlArea client in pixels
target_height: i32
Height of the GlArea client in pixels
aa: AaMode
Antialiasing mode (supported Single
and Multi(4)
)
Methods
impl Viewport
[src]
impl Viewport
pub fn aspect_ratio(&self) -> f32
[src]
pub fn aspect_ratio(&self) -> f32
The ratio between width and height of the
pub fn with_aa(aa: AaMode, target_width: i32, target_height: i32) -> Self
[src]
pub fn with_aa(aa: AaMode, target_width: i32, target_height: i32) -> Self
Creates a new Viewport from the specified source GlArea size. width
and height
will be determined accordingly and taking into account supersampling if applicable
aa
antialiasing mode, currently supportedSingle
andMulti(4)
target_width
width of the client area of the containing widgettarget_height
height of the client area of the containing widget`