Expand description
The Presenter trait and WindowHandle.
The Presenter trait: what a renderer crate implements to rasterize a grid and present it
to a window surface.
Presenter is an Output supertrait plus window-surface
operations, with no input methods: the event loop owns input, and
WindowBackend forwards translated events into its own queue instead.
| Presenter | present() | init_surface() |
|---|---|---|
SoftwareRenderer (retroglyph-software) | Copies pixel buffer to softbuffer surface | Creates softbuffer::Context + Surface |
GlRenderer (retroglyph-gl) | Instanced draw + swaps buffers | Creates a GL context (glutin native / WebGL2 wasm) from the window |
WgpuRenderer (retroglyph-wgpu) | Submits a render pass + presents the swap chain | Creates a wgpu::Surface, Device, and Queue |
See the crate-level docs (crate root, “DPI, scale, and the resize contract” and
“Threading model” sections) for the physical-pixel/no-auto-scaling contract on
cell_size, the sub-cell-remainder behavior on
resize_surface, and the single-threaded execution model
every Presenter implementation runs under.
Enums§
- Generic
Surface Error - A ready-made, string-backed
SurfaceErrorfor presenters whose underlying surface library reports failures as opaque strings rather than a structured error enum.
Traits§
- Presenter
- A renderer that rasterizes grid content and presents it to a window surface.
- Recoverable
Error - A surface-lifecycle error that can optionally signal whether it’s worth retrying.
- Window
Handle - A window/display handle pair, as one trait.
Functions§
- cell_
art_ glyph - The glyph a
Presentershould paint art (a bitmap-font glyph or a tileset sprite) for, orNonewhen this cell draws none.