pub struct TextRenderer { /* private fields */ }Expand description
GPU-accelerated text renderer using glyphon
Implementations§
Source§impl TextRenderer
impl TextRenderer
Sourcepub fn new(
device: &Device,
queue: &Queue,
format: TextureFormat,
width: u32,
height: u32,
) -> Result<Self>
pub fn new( device: &Device, queue: &Queue, format: TextureFormat, width: u32, height: u32, ) -> Result<Self>
Create a new text renderer
Sourcepub fn resize(
&mut self,
_device: &Device,
queue: &Queue,
width: u32,
height: u32,
)
pub fn resize( &mut self, _device: &Device, queue: &Queue, width: u32, height: u32, )
Update viewport dimensions
Sourcepub fn prepare(
&mut self,
device: &Device,
queue: &Queue,
text_items: &[TextItem],
) -> Result<()>
pub fn prepare( &mut self, device: &Device, queue: &Queue, text_items: &[TextItem], ) -> Result<()>
Prepare text items for rendering
Sourcepub fn render<'a>(&'a self, render_pass: &mut RenderPass<'a>) -> Result<()>
pub fn render<'a>(&'a self, render_pass: &mut RenderPass<'a>) -> Result<()>
Render the prepared text
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the cache (call when changing scenes/charts)
Auto Trait Implementations§
impl Freeze for TextRenderer
impl !RefUnwindSafe for TextRenderer
impl Send for TextRenderer
impl Sync for TextRenderer
impl Unpin for TextRenderer
impl UnsafeUnpin for TextRenderer
impl !UnwindSafe for TextRenderer
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