Struct three_d::RenderTarget [−][src]
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]
context: &Context,
color_texture: &'a ColorTargetTexture2D,
depth_texture: &'b DepthTargetTexture2D
) -> Result<Self, Error>
pub fn new_color(
context: &Context,
color_texture: &'a ColorTargetTexture2D
) -> Result<Self, Error>
[src]
context: &Context,
color_texture: &'a ColorTargetTexture2D
) -> Result<Self, Error>
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]
context: &Context,
depth_texture: &'b DepthTargetTexture2D
) -> Result<Self, Error>
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]
&self,
clear_state: &ClearState,
render: F
) -> Result<(), Error>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,