pub struct MeshRenderer { /* private fields */ }Expand description
MeshRenderer is a simplified interface to drawing a mesh and texture with a specified “draw configuration” ([Draw]).
Implementations§
Source§impl MeshRenderer
impl MeshRenderer
Sourcepub fn new(cx: &Context, pipeline: &MeshRenderPipeline) -> Self
pub fn new(cx: &Context, pipeline: &MeshRenderPipeline) -> Self
Creates a new MeshRenderer.
The renderer is not necessarily tied to MeshRenderPipeline. The pipeline handle only acts a reference pipeline layout.
Sourcepub fn free(&mut self)
pub fn free(&mut self)
Resets the previously allocated buffers, making them available for reuse.
Call this at the start or end of every frame in order to maintain acceptable spatial performance.
Sourcepub fn bind_sampler<'a>(
&mut self,
cx: &Context,
pass: &'a mut RenderPass<'_>,
sampler: &Sampler,
)
pub fn bind_sampler<'a>( &mut self, cx: &Context, pass: &'a mut RenderPass<'_>, sampler: &Sampler, )
Binds a sampler for use with the proceeding draw calls.
Sourcepub fn draw(
&mut self,
cx: &Context,
pass: &mut ArenaRenderPass<'_>,
draw: MeshDraw<'_>,
)
pub fn draw( &mut self, cx: &Context, pass: &mut ArenaRenderPass<'_>, draw: MeshDraw<'_>, )
Draws a textured mesh with draw parameters.
Trait Implementations§
Source§impl Debug for MeshRenderer
impl Debug for MeshRenderer
Auto Trait Implementations§
impl Freeze for MeshRenderer
impl !RefUnwindSafe for MeshRenderer
impl Send for MeshRenderer
impl Sync for MeshRenderer
impl Unpin for MeshRenderer
impl !UnwindSafe for MeshRenderer
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more