pub struct SharedRenderTarget {
pub bounds: Rect,
pub width: usize,
pub height: usize,
pub color_buffer: FrameBuffer,
pub depth_buffer: Vec<f32>,
pub dirty: bool,
pub background_color: Color,
}Expand description
Offscreen Shared Render Target for 3D Viewports.
Fields§
§bounds: Rect§width: usize§height: usize§color_buffer: FrameBuffer§depth_buffer: Vec<f32>§dirty: bool§background_color: ColorImplementations§
Sourcepub fn resize(&mut self, bounds: Rect)
pub fn resize(&mut self, bounds: Rect)
Resizes the shared render target if the viewport dimensions change.
Sourcepub fn mark_dirty(&mut self)
pub fn mark_dirty(&mut self)
Marks the 3D target as dirty, forcing re-rendering on the next frame.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears the color buffer to background color and resets the depth buffer.
Sourcepub fn render_if_dirty(&mut self, scene: &Scene3D)
pub fn render_if_dirty(&mut self, scene: &Scene3D)
Renders the 3D scene into this offscreen buffer if marked dirty.
Sourcepub fn render_scene(&mut self, scene: &Scene3D)
pub fn render_scene(&mut self, scene: &Scene3D)
Forces rendering of the 3D scene into this offscreen buffer.
Sourcepub fn composite_to_surface(&self, dst: &mut FrameBuffer, clip: Option<Rect>)
pub fn composite_to_surface(&self, dst: &mut FrameBuffer, clip: Option<Rect>)
Composites (blits) the rendered 3D viewport into a target 2D FrameBuffer.
Sourcepub fn as_raw_bytes(&self) -> &[u8] ⓘ
pub fn as_raw_bytes(&self) -> &[u8] ⓘ
Safe zero-copy byte slice view of color buffer pixels.
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more