pub struct RenderContext { /* private fields */ }Expand description
An interface used for creating command buffers for rendering.
Implementations§
Source§impl RenderContext
impl RenderContext
Sourcepub fn new<'a>(instance: &Instance<'a>) -> Self
pub fn new<'a>(instance: &Instance<'a>) -> Self
Creates a new RenderContext.
§Arguments
instance- the Instance to use for rendering. Borrowed for the duration of the function execution.
§Returns
The created RenderContext.
Sourcepub fn create_render_pass_raw(
&mut self,
desc: &RenderPassDescriptor<'_>,
) -> RenderPass<'_>
pub fn create_render_pass_raw( &mut self, desc: &RenderPassDescriptor<'_>, ) -> RenderPass<'_>
Creates a wgpu::RenderPass from a raw wgpu::RenderPassDescriptor. Should generally only be used internally.
§Arguments
desc- the wgpu::RenderPassDescriptor to use when creating the wgpu::RenderPass.
§Returns
The wgpu::RenderPass matching the argument.
Sourcepub fn clear(&mut self, surf_view: &TextureView, color: Color) -> RenderPass<'_>
pub fn clear(&mut self, surf_view: &TextureView, color: Color) -> RenderPass<'_>
Creates a wgpu::RenderPass which starts by clearing the input texture to a color. Should generally only be used internally.
§Arguments
surf_view- the wgpu::TextureView to clear.color- the wgpu::Color to clear the texture to.
§Returns
The wgpu::RenderPass, ready for rendering, starting with a clear op.
Sourcepub fn to_command_buffer(self) -> CommandBuffer
pub fn to_command_buffer(self) -> CommandBuffer
Finishes rendering and creates a command buffer.
This method consumes self.
This should generally only be used internally.
§Returns
The wgpu::CommandBuffer which may be submit to the GPU for rendering.
Auto Trait Implementations§
impl !RefUnwindSafe for RenderContext
impl !UnwindSafe for RenderContext
impl Freeze for RenderContext
impl Send for RenderContext
impl Sync for RenderContext
impl Unpin for RenderContext
impl UnsafeUnpin for RenderContext
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.