pub struct RenderTarget<'a> { /* private fields */ }Expand description
A render target that can be rendered to.
Implementations§
Source§impl<'a> RenderTarget<'a>
impl<'a> RenderTarget<'a>
Sourcepub fn new(
ctx: &'a WgpuContext,
color_view: &'a TextureView,
depth_view: Option<&'a TextureView>,
width: u32,
height: u32,
format: TextureFormat,
) -> Self
pub fn new( ctx: &'a WgpuContext, color_view: &'a TextureView, depth_view: Option<&'a TextureView>, width: u32, height: u32, format: TextureFormat, ) -> Self
Create a new render target.
Sourcepub fn from_surface(
ctx: &'a WgpuContext,
surface_view: &'a TextureView,
depth_texture: Option<&'a DepthTexture>,
width: u32,
height: u32,
format: TextureFormat,
) -> Self
pub fn from_surface( ctx: &'a WgpuContext, surface_view: &'a TextureView, depth_texture: Option<&'a DepthTexture>, width: u32, height: u32, format: TextureFormat, ) -> Self
Create a render target from a surface texture.
Sourcepub fn format(&self) -> TextureFormat
pub fn format(&self) -> TextureFormat
Get the texture format.
Sourcepub fn begin_render_pass<'p>(
&'a self,
encoder: &'p mut CommandEncoder,
clear: ClearState,
) -> RenderPass<'p>where
'a: 'p,
pub fn begin_render_pass<'p>(
&'a self,
encoder: &'p mut CommandEncoder,
clear: ClearState,
) -> RenderPass<'p>where
'a: 'p,
Create a render pass with the given clear state.
Sourcepub fn clear(&self, clear: ClearState)
pub fn clear(&self, clear: ClearState)
Clear the render target with the given clear state.
Sourcepub fn context(&self) -> &WgpuContext
pub fn context(&self) -> &WgpuContext
Get a reference to the context.
Sourcepub fn color_view(&self) -> &TextureView
pub fn color_view(&self) -> &TextureView
Get the color view.
Sourcepub fn depth_view(&self) -> Option<&TextureView>
pub fn depth_view(&self) -> Option<&TextureView>
Get the depth view if available.
Auto Trait Implementations§
impl<'a> Freeze for RenderTarget<'a>
impl<'a> !RefUnwindSafe for RenderTarget<'a>
impl<'a> Send for RenderTarget<'a>
impl<'a> Sync for RenderTarget<'a>
impl<'a> Unpin for RenderTarget<'a>
impl<'a> !UnwindSafe for RenderTarget<'a>
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.