Struct three_d::core::RenderTarget[][src]

pub struct RenderTarget<'a, 'b> { /* fields omitted */ }

Use a render target to render into a texture (color, depth or both). Can be created each time it is needed.

Implementations

impl<'a, 'b> RenderTarget<'a, 'b>[src]

pub fn new(
    context: &Context,
    color_texture: &'a ColorTargetTexture2D,
    depth_texture: &'b DepthTargetTexture2D
) -> Result<Self, Error>
[src]

Constructs a new render target that enables rendering into the given color and depth textures.

pub fn new_color(
    context: &Context,
    color_texture: &'a ColorTargetTexture2D
) -> Result<Self, Error>
[src]

Constructs a new render target that enables rendering into the given color texture.

pub fn new_depth(
    context: &Context,
    depth_texture: &'b DepthTargetTexture2D
) -> Result<Self, Error>
[src]

Constructs a new render target that enables rendering into the given depth texture.

pub fn write<F: FnOnce() -> Result<(), Error>>(
    &self,
    clear_state: &ClearState,
    render: F
) -> Result<(), Error>
[src]

Renders whatever rendered in the render closure into the textures defined at construction. Before writing, the textures are cleared based on the given clear state.

pub fn copy_to_screen(&self, viewport: Viewport) -> Result<(), Error>[src]

Copies the content of the color and depth textures in this render target to the screen.

Errors

Will return an error if this render target is not constructed with both a color and depth texture.

pub fn copy_color_to_screen(&self, viewport: Viewport) -> Result<(), Error>[src]

Copies the content of the color texture in this render target to the screen.

Errors

Will return an error if this render target is not constructed with a color texture.

pub fn copy_depth_to_screen(&self, viewport: Viewport) -> Result<(), Error>[src]

Copies the content of the depth texture in this render target to the screen.

Errors

Will return an error if this render target is not constructed with a depth texture.

pub fn copy(&self, other: &Self, viewport: Viewport) -> Result<(), Error>[src]

Copies the content of the color and depth textures in this render target to another render target.

Errors

Will return an error if this render target is not constructed with both a color and depth texture.

pub fn copy_color(&self, other: &Self, viewport: Viewport) -> Result<(), Error>[src]

Copies the content of the color texture in this render target to another render target.

Errors

Will return an error if this render target is not constructed with a color texture.

pub fn copy_depth(&self, other: &Self, viewport: Viewport) -> Result<(), Error>[src]

Copies the content of the depth texture in this render target to another render target.

Errors

Will return an error if this render target is not constructed with a depth texture.

Trait Implementations

impl Drop for RenderTarget<'_, '_>[src]

Auto Trait Implementations

impl<'a, 'b> !RefUnwindSafe for RenderTarget<'a, 'b>

impl<'a, 'b> !Send for RenderTarget<'a, 'b>

impl<'a, 'b> !Sync for RenderTarget<'a, 'b>

impl<'a, 'b> Unpin for RenderTarget<'a, 'b>

impl<'a, 'b> !UnwindSafe for RenderTarget<'a, 'b>

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.