pub struct GlRenderer { /* private fields */ }Expand description
The live GL renderer: a Presenter, wrapped in
WindowBackend to form a full
Backend for the windowing loop.
It does not implement Input or
Cursor itself: a GL renderer cannot present without a
live context, so there is no headless-with-input use for a bare Terminal<GlRenderer>. In
windowed use WindowBackend owns the input queue (with its Mouse(Moved) coalescing) and the
no-op cursor, so a duplicate queue here would only ever be dead. See the sub-cell offset note
on Presenter for the shared rendering contract.
Build one with GlBackendBuilder. Before the windowing loop calls
init_surface there is no GL context; drawing updates only the
CPU-side instance array, and present is a no-op. Once the surface
exists, present uploads changed cells and issues the single instanced draw call.
Trait Implementations§
Source§impl Drop for GlRenderer
impl Drop for GlRenderer
Source§impl Output for GlRenderer
impl Output for GlRenderer
Source§type Error = Infallible
type Error = Infallible
Source§fn draw_layers<'a, I>(&mut self, content: I) -> Result<(), Self::Error>
fn draw_layers<'a, I>(&mut self, content: I) -> Result<(), Self::Error>
Source§fn needs_full_frame(&self) -> bool
fn needs_full_frame(&self) -> bool
true if the backend needs the entire frame (all cells on
all layers) on every call to draw_layers, rather
than just the changed cells. Read moreSource§fn composites_layers(&self) -> bool
fn composites_layers(&self) -> bool
draw_layers. Read moreSource§fn flush(&mut self) -> Result<(), Self::Error>
fn flush(&mut self) -> Result<(), Self::Error>
Source§impl Presenter for GlRenderer
impl Presenter for GlRenderer
Source§type SurfaceError = SurfaceError
type SurfaceError = SurfaceError
Source§fn init_surface(
&mut self,
window: Arc<dyn WindowHandle>,
) -> Result<(), SurfaceError>
fn init_surface( &mut self, window: Arc<dyn WindowHandle>, ) -> Result<(), SurfaceError>
Source§fn resize_surface(&mut self, width: u32, height: u32)
fn resize_surface(&mut self, width: u32, height: u32)
Source§fn present(&mut self) -> Result<(), SurfaceError>
fn present(&mut self) -> Result<(), SurfaceError>
Source§fn geometry(&self) -> CellGeometry
fn geometry(&self) -> CellGeometry
CellGeometry rather than the raw
(width, height) pair cell_size returns. Read moreSource§fn scale_factor_changed(&mut self, _scale_factor: f64)
fn scale_factor_changed(&mut self, _scale_factor: f64)
Auto Trait Implementations§
impl !Freeze for GlRenderer
impl RefUnwindSafe for GlRenderer
impl !Send for GlRenderer
impl !Sync for GlRenderer
impl Unpin for GlRenderer
impl UnsafeUnpin for GlRenderer
impl UnwindSafe for GlRenderer
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.