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

pub struct RenderTarget<'a, 'b, T: TextureValueType> { /* fields omitted */ }
Expand description

Adds additional functionality to write to and copy from both a ColorTargetTexture2D and a DepthTargetTexture2D at the same time. It purely adds functionality, so it can be created each time it is needed, the data is saved in the textures.

Implementations

impl<'a, 'b, T: TextureValueType> RenderTarget<'a, 'b, T>[src]

pub fn new(
    context: &Context,
    color_texture: &'a ColorTargetTexture2D<T>,
    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 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(
    &self,
    destination: CopyDestination<'_, '_, '_, '_, T>,
    viewport: Viewport,
    write_mask: WriteMask
) -> Result<(), Error>
[src]

Copies the content of the color and depth textures in this render target to the specified viewport of the specified destination. Only copies the channels given by the write mask.

Trait Implementations

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

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.