pub struct TextPipeline {
pipeline: RenderPipeline,
bgl: BindGroupLayout,
vertex_buffer: Buffer,
vertex_capacity: u64,
atlas: TextAtlas,
}Expand description
Text GPU pipeline. One render pipeline + a growable vertex buffer.
Fields§
§pipeline: RenderPipeline§bgl: BindGroupLayout§vertex_buffer: Buffer§vertex_capacity: u64§atlas: TextAtlasImplementations§
Source§impl TextPipeline
impl TextPipeline
pub fn new(device: &Device, queue: &Queue, format: TextureFormat) -> Self
Sourcepub fn record(
&mut self,
encoder: &mut CommandEncoder,
queue: &Queue,
device: &Device,
target: &TextureView,
frames: &[TextFrame],
render_w: u32,
render_h: u32,
)
pub fn record( &mut self, encoder: &mut CommandEncoder, queue: &Queue, device: &Device, target: &TextureView, frames: &[TextFrame], render_w: u32, render_h: u32, )
Render every queued text frame into target. No-op when the
frame list is empty.
Sourcefn append_text(
&mut self,
verts: &mut Vec<TextQuadVertex>,
frame: &TextFrame,
render_w: u32,
render_h: u32,
)
fn append_text( &mut self, verts: &mut Vec<TextQuadVertex>, frame: &TextFrame, render_w: u32, render_h: u32, )
Layout one text frame and append its glyph quads to verts.
Lines are split on \n; horizontal anchor centres each line on
frame.x, vertical anchor centres the whole block on frame.y.
Auto Trait Implementations§
impl Freeze for TextPipeline
impl !RefUnwindSafe for TextPipeline
impl Send for TextPipeline
impl Sync for TextPipeline
impl Unpin for TextPipeline
impl !UnwindSafe for TextPipeline
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