pub struct Renderer {
text_renderer: TextRendererProvider,
rect_renderer: RectRenderer,
}
Fields§
§text_renderer: TextRendererProvider
§rect_renderer: RectRenderer
Implementations§
Source§impl Renderer
impl Renderer
Sourcepub fn new(
context: &PossiblyCurrentContext,
renderer_preference: Option<RendererPreference>,
) -> Result<Self, Error>
pub fn new( context: &PossiblyCurrentContext, renderer_preference: Option<RendererPreference>, ) -> Result<Self, Error>
Create a new renderer.
This will automatically pick between the GLES2 and GLSL3 renderer based on the GPU’s supported OpenGL version.
pub fn draw_cells<I: Iterator<Item = RenderableCell>>( &mut self, size_info: &SizeInfo, glyph_cache: &mut GlyphCache, cells: I, )
Sourcepub fn draw_string(
&mut self,
point: Point<usize>,
fg: Rgb,
bg: Rgb,
string_chars: impl Iterator<Item = char>,
size_info: &SizeInfo,
glyph_cache: &mut GlyphCache,
)
pub fn draw_string( &mut self, point: Point<usize>, fg: Rgb, bg: Rgb, string_chars: impl Iterator<Item = char>, size_info: &SizeInfo, glyph_cache: &mut GlyphCache, )
Draw a string in a variable location. Used for printing the render timer, warnings and errors.
pub fn with_loader<F, T>(&mut self, func: F) -> T
Sourcepub fn draw_rects(
&mut self,
size_info: &SizeInfo,
metrics: &Metrics,
rects: Vec<RenderRect>,
)
pub fn draw_rects( &mut self, size_info: &SizeInfo, metrics: &Metrics, rects: Vec<RenderRect>, )
Draw all rectangles simultaneously to prevent excessive program swaps.
pub fn finish(&self)
Sourcepub fn set_viewport(&self, size: &SizeInfo)
pub fn set_viewport(&self, size: &SizeInfo)
Set the viewport for cell rendering.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Renderer
impl RefUnwindSafe for Renderer
impl Send for Renderer
impl Sync for Renderer
impl Unpin for Renderer
impl UnwindSafe for Renderer
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.