pub struct Renderer { /* private fields */ }Expand description
Encapsulates renderer state.
Implementations§
Source§impl Renderer
impl Renderer
Sourcepub fn new(device: &Device, texture_format: TextureFormat) -> Self
pub fn new(device: &Device, texture_format: TextureFormat) -> Self
Creates a new renderer.
Sourcepub fn add_font(&mut self, font: &[u8]) -> Vec<Attrs>
pub fn add_font(&mut self, font: &[u8]) -> Vec<Attrs>
Adds a font to the renderer, returning attributes for each face in the font.
Sourcepub fn prepare_text(
&mut self,
contents: impl AsRef<str>,
metrics: Metrics,
attrs: Attrs,
) -> PreparedText
pub fn prepare_text( &mut self, contents: impl AsRef<str>, metrics: Metrics, attrs: Attrs, ) -> PreparedText
Prepares text for rendering.
pub fn suspend(&mut self)
pub fn resume(&mut self, device: &Device)
Sourcepub fn prepare(
&mut self,
device: &Device,
queue: &Queue,
target_size: Extent3d,
canvas: &Canvas<'_>,
) -> Result<(), Error>
pub fn prepare( &mut self, device: &Device, queue: &Queue, target_size: Extent3d, canvas: &Canvas<'_>, ) -> Result<(), Error>
Prepares a scene for rendering.
Sourcepub fn render<'rpass>(&'rpass self, rpass: &'rpass mut RenderPass<'rpass>)
pub fn render<'rpass>(&'rpass self, rpass: &'rpass mut RenderPass<'rpass>)
Renders a prepared scene.
Auto Trait Implementations§
impl !Freeze for Renderer
impl !RefUnwindSafe for Renderer
impl Send for Renderer
impl Sync for Renderer
impl Unpin for Renderer
impl !UnwindSafe for Renderer
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