pub struct WgpuRenderer { /* private fields */ }Expand description
The live wgpu renderer: a Presenter, wrapped in
WindowBackend to form a full
Backend for the windowing loop.
It does not implement Input or
Cursor itself: a GPU renderer cannot present without a
live device, so there is no headless-with-input use for a bare Terminal<WgpuRenderer>. 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 WgpuBackendBuilder. Before the windowing loop calls
init_surface there is no device; drawing updates only the CPU-side
instance arrays, and present is a no-op. Once the device exists,
present uploads the frame and encodes one render pass.
Trait Implementations§
Source§impl Output for WgpuRenderer
impl Output for WgpuRenderer
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 WgpuRenderer
impl Presenter for WgpuRenderer
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 WgpuRenderer
impl !RefUnwindSafe for WgpuRenderer
impl Send for WgpuRenderer
impl Sync for WgpuRenderer
impl Unpin for WgpuRenderer
impl UnsafeUnpin for WgpuRenderer
impl !UnwindSafe for WgpuRenderer
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.