pub struct TextCallBuffer {
pub calls: Vec<TextDrawCall>,
/* private fields */
}Expand description
An overlay draw list under assembly, with its recycled geometry pool.
Fields§
§calls: Vec<TextDrawCall>Calls assembled so far, in draw order.
Implementations§
Source§impl TextCallBuffer
impl TextCallBuffer
Sourcepub fn recycle(&mut self, spent: Vec<TextDrawCall>)
pub fn recycle(&mut self, spent: Vec<TextDrawCall>)
Reclaim a spent draw list: each call’s geometry feeds later builds and
the drained list becomes the backing for the next calls.
Sourcepub fn geometry(&mut self) -> (Vec<TextVertex>, Vec<u16>)
pub fn geometry(&mut self) -> (Vec<TextVertex>, Vec<u16>)
An empty vertex/index buffer pair, reusing spent capacity when any is pooled.
Sourcepub fn park(&mut self, vertices: Vec<TextVertex>, indices: Vec<u16>)
pub fn park(&mut self, vertices: Vec<TextVertex>, indices: Vec<u16>)
Return a pair taken with TextCallBuffer::geometry that ended up
unused, so its capacity stays pooled.
Sourcepub fn take(&mut self) -> Vec<TextDrawCall>
pub fn take(&mut self) -> Vec<TextDrawCall>
Hand the assembled list to its consumer, leaving this buffer empty.
Sourcepub fn sort_by_layer(&mut self)
pub fn sort_by_layer(&mut self)
Reorder the assembled calls by ascending draw layer, keeping same-layer calls in insertion order. Equivalent to a stable sort by layer, but the sort runs over indices in persistent scratch and the permutation is applied with swaps, so a steady-state frame allocates nothing. Skipped entirely when every call sits at layer 0.