pub struct GlyphRenderer { /* private fields */ }Expand description
GPU resources for glyph rendering.
Implementations§
Source§impl GlyphRenderer
impl GlyphRenderer
Sourcepub fn new(
device: &Device,
uniform_buffer: &Buffer,
surface_format: TextureFormat,
max_glyphs: u32,
) -> Self
pub fn new( device: &Device, uniform_buffer: &Buffer, surface_format: TextureFormat, max_glyphs: u32, ) -> Self
Create a new glyph renderer.
Sourcepub fn set_config(&mut self, config: GlyphConfig)
pub fn set_config(&mut self, config: GlyphConfig)
Update glyph configuration.
Sourcepub fn update_from_field(
&mut self,
queue: &Queue,
bounds: f32,
sample_field: impl Fn(Vec3) -> Vec3,
)
pub fn update_from_field( &mut self, queue: &Queue, bounds: f32, sample_field: impl Fn(Vec3) -> Vec3, )
Update glyphs from vector field data.
sample_field is called with (x, y, z) position and should return the vector at that point.
Sourcepub fn update_from_particles(
&mut self,
queue: &Queue,
positions: &[Vec3],
velocities: &[Vec3],
sample_rate: u32,
)
pub fn update_from_particles( &mut self, queue: &Queue, positions: &[Vec3], velocities: &[Vec3], sample_rate: u32, )
Update glyphs from particle velocities.
Sourcepub fn render(&self, render_pass: &mut RenderPass<'_>)
pub fn render(&self, render_pass: &mut RenderPass<'_>)
Render the glyphs.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if glyphs are enabled.
Sourcepub fn config(&self) -> &GlyphConfig
pub fn config(&self) -> &GlyphConfig
Get current config.
Auto Trait Implementations§
impl Freeze for GlyphRenderer
impl !RefUnwindSafe for GlyphRenderer
impl Send for GlyphRenderer
impl Sync for GlyphRenderer
impl Unpin for GlyphRenderer
impl !UnwindSafe for GlyphRenderer
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.