[−][src]Function conrod_piston::draw::primitive
pub fn primitive<'a, Img, G, T, C, F>(
primitive: Primitive,
context: Context,
graphics: &'a mut G,
text_texture_cache: &'a mut T,
glyph_cache: &'a mut GlyphCache,
image_map: &'a Map<Img>,
glyph_rectangles: &mut Vec<([f64; 4], [f64; 4])>,
cache_queued_glyphs: C,
texture_from_image: F
) where
G: Graphics<Texture = T>,
T: ImageSize,
C: FnMut(&mut G, &mut T, Rect<u32>, &[u8]),
F: FnMut(&Img) -> &T,
Render a single Primitive
.
Params:
primitive
- ThePrimitive
that is to be rendered to the screen.context
- The piston2d-graphics drawing context.graphics
- The pistonGraphics
backend.text_texture_cache
- Some texture typeT
upon which we can cache text glyphs.glyph_cache
- The RustTypeCache
used to cache glyphs in ourtext_texture_cache
.image_map
- Mappings from image widget indices to their associated image data.glyph_rectangles
- A re-usable buffer for collecting positioning rectangles for glyphs.cache_queue_glyphs
- A function for caching glyphs within the given texture cache.texture_from_image
- A function that borrows a drawable textureT
from anImg
. In many cases,Img
may be the same type asT
, however we provide this to allow for flexibility.