Realm

oa::ui::Viewport

Passive view description for rendering. Declares camera, target, viewport, scissor, layer mask, and clear values. setup_image_2d/setup_image_aspect_fit manufacture and retain an orthographic camera internally; an externally borrowed camera supplied later through Self::set_camera takes precedence again. Donor: oa::Viewport.

StRust public API

Declaration

pub struct Viewport<'a> { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn set_mode(&mut self, mode: ViewportMode)
pub const fn mode(&self) -> ViewportMode
pub fn set_camera(&mut self, camera: Option<&'a Camera>)
pub fn camera(&self) -> Option<&Camera>
pub fn set_target(&mut self, target: Option<&'a Texture>)
pub const fn target(&self) -> Option<&'a Texture>
pub fn set_viewport(&mut self, viewport: ViewportDesc) -> Result<()>
pub const fn viewport(&self) -> ViewportDesc
pub fn set_scissor(&mut self, scissor: ScissorDesc) -> Result<()>
pub fn disable_scissor(&mut self)
pub const fn is_scissor_enabled(&self) -> bool
pub const fn scissor(&self) -> ScissorDesc
pub fn set_layer_mask(&mut self, mask: RenderLayer)
pub const fn layer_mask(&self) -> RenderLayer
pub const fn is_layer_visible(&self, layer: RenderLayer) -> bool
pub fn set_clear_color(&mut self, color: [f32; 4]) -> Result<()>
pub const fn clear_color(&self) -> [f32; 4]
pub fn set_clear_depth(&mut self, depth: f32) -> Result<()>
pub const fn clear_depth(&self) -> f32
pub fn is_valid(&self) -> bool
pub fn setup_image_2d( &mut self, image_width: f32, image_height: f32, target: &'a Texture, viewport: ViewportDesc, ) -> Result<()>
pub fn setup_image_aspect_fit( &mut self, image_width: f32, image_height: f32, window_width: f32, window_height: f32, target: &'a Texture, ) -> Result<()>

Associated Functions

pub fn with_mode(mode: ViewportMode) -> Self
fn default() -> Self

Public Method Documentation

pub fn set_mode( &mut self, mode: ViewportMode )
No public source comment is attached to this declaration.
pub const fn mode( &self ) -> ViewportMode
No public source comment is attached to this declaration.
pub fn set_camera( &mut self, camera: Option<&'a Camera> )
No public source comment is attached to this declaration.
pub fn camera( &self ) -> Option<&Camera>
No public source comment is attached to this declaration.
pub fn set_target( &mut self, target: Option<&'a Texture> )
No public source comment is attached to this declaration.
pub const fn target( &self ) -> Option<&'a Texture>
No public source comment is attached to this declaration.
pub fn set_viewport(&mut self, viewport: ViewportDesc) -> Result<()>
No public source comment is attached to this declaration.
pub const fn viewport( &self ) -> ViewportDesc
No public source comment is attached to this declaration.
pub fn set_scissor(&mut self, scissor: ScissorDesc) -> Result<()>
No public source comment is attached to this declaration.
pub fn disable_scissor( &mut self )
No public source comment is attached to this declaration.
pub const fn is_scissor_enabled( &self ) -> bool
No public source comment is attached to this declaration.
pub const fn scissor( &self ) -> ScissorDesc
No public source comment is attached to this declaration.
pub fn set_layer_mask( &mut self, mask: RenderLayer )
No public source comment is attached to this declaration.
pub const fn layer_mask( &self ) -> RenderLayer
No public source comment is attached to this declaration.
pub const fn is_layer_visible( &self, layer: RenderLayer ) -> bool
No public source comment is attached to this declaration.
pub fn set_clear_color(&mut self, color: [f32; 4]) -> Result<()>
No public source comment is attached to this declaration.
pub const fn clear_color( &self ) -> [f32; 4]
No public source comment is attached to this declaration.
pub fn set_clear_depth(&mut self, depth: f32) -> Result<()>
No public source comment is attached to this declaration.
pub const fn clear_depth( &self ) -> f32
No public source comment is attached to this declaration.
pub fn is_valid( &self ) -> bool
No public source comment is attached to this declaration.
pub fn setup_image_2d( &mut self, image_width: f32, image_height: f32, target: &'a Texture, viewport: ViewportDesc, ) -> Result<()>
No public source comment is attached to this declaration.
pub fn setup_image_aspect_fit( &mut self, image_width: f32, image_height: f32, window_width: f32, window_height: f32, target: &'a Texture, ) -> Result<()>
No public source comment is attached to this declaration.
pub fn with_mode( mode: ViewportMode ) -> Self
No public source comment is attached to this declaration.
fn default() -> Self
No public source comment is attached to this declaration.