[][src]Struct gfx_glyph::DrawBuilder

#[must_use]
pub struct DrawBuilder<'a, 'font, R: Resources, F: Factory<R>, H, DV> { /* fields omitted */ }

Short-lived builder for drawing glyphs, constructed from GlyphBrush::use_queue.

Example

glyph_brush
    .use_queue()
    .depth_target(&gfx_depth)
    .draw(&mut gfx_encoder, &gfx_color)?;

Methods

impl<'a, 'font, R: Resources, F: Factory<R>, H: BuildHasher, DV> DrawBuilder<'a, 'font, R, F, H, DV>[src]

pub fn transform<M: Into<[[f32; 4]; 4]>>(self, transform: M) -> Self[src]

Use a custom position transform (e.g. a projection) replacing the default_transform.

Example

let projection = gfx_glyph::default_transform(&gfx_color);

glyph_brush.use_queue().transform(projection)

pub fn depth_target<D>(self, depth: &'a D) -> DrawBuilder<'a, 'font, R, F, H, D>[src]

Set a depth buffer target to perform depth testing against.

Example

glyph_brush.use_queue().depth_target(&gfx_depth)

Raw usage

Can also be used with gfx raw depth views if necessary. The Format must also be provided.

glyph_brush
    .use_queue()
    .depth_target(&(raw_depth_view, format::Depth::get_format()))

impl<'a, R: Resources, F: Factory<R>, H: BuildHasher, DV: RawAndFormat<Raw = RawDepthStencilView<R>>, '_> DrawBuilder<'a, '_, R, F, H, DV>[src]

pub fn draw<C, CV>(
    self,
    encoder: &mut Encoder<R, C>,
    target: &CV
) -> Result<(), String> where
    C: CommandBuffer<R>,
    CV: RawAndFormat<Raw = RawRenderTargetView<R>>, 
[src]

Draws all queued sections onto a render target. See queue.

Trims the cache, see caching behaviour.

Example

glyph_brush
    .use_queue()
    .draw(&mut gfx_encoder, &gfx_color)?;

Raw usage

Can also be used with gfx raw render views if necessary. The Format must also be provided.

glyph_brush
    .use_queue()
    .draw(&mut gfx_encoder, &(raw_render_view, format::Srgba8::get_format()))?;

impl<'a, R: Resources, F: Factory<R>, H: BuildHasher, '_> DrawBuilder<'a, '_, R, F, H, ()>[src]

pub fn draw<C, CV>(
    self,
    encoder: &mut Encoder<R, C>,
    target: &CV
) -> Result<(), String> where
    C: CommandBuffer<R>,
    CV: RawAndFormat<Raw = RawRenderTargetView<R>>, 
[src]

Auto Trait Implementations

impl<'a, 'font, R, F, H, DV> Send for DrawBuilder<'a, 'font, R, F, H, DV> where
    DV: Sync,
    F: Send,
    H: Send,
    <R as Resources>::Buffer: Send + Sync,
    <R as Resources>::DepthStencilView: Send + Sync,
    <R as Resources>::Mapping: Send,
    <R as Resources>::PipelineStateObject: Send + Sync,
    <R as Resources>::Program: Send + Sync,
    <R as Resources>::RenderTargetView: Send + Sync,
    <R as Resources>::Sampler: Send + Sync,
    <R as Resources>::ShaderResourceView: Send + Sync,
    <R as Resources>::Texture: Send + Sync

impl<'a, 'font, R, F, H, DV> Sync for DrawBuilder<'a, 'font, R, F, H, DV> where
    DV: Sync,
    F: Sync,
    H: Sync,
    <R as Resources>::Buffer: Send + Sync,
    <R as Resources>::DepthStencilView: Send + Sync,
    <R as Resources>::Mapping: Send,
    <R as Resources>::PipelineStateObject: Send + Sync,
    <R as Resources>::Program: Send + Sync,
    <R as Resources>::RenderTargetView: Send + Sync,
    <R as Resources>::Sampler: Send + Sync,
    <R as Resources>::ShaderResourceView: Send + Sync,
    <R as Resources>::Texture: Send + Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]