Skip to main content

Module presenter

Module presenter 

Source
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.

Presenterpresent()init_surface()
SoftwareRenderer (retroglyph-software)Copies pixel buffer to softbuffer surfaceCreates softbuffer::Context + Surface
GlRenderer (retroglyph-gl)Instanced draw + swaps buffersCreates a GL context (glutin native / WebGL2 wasm) from the window
WgpuRenderer (retroglyph-wgpu)Submits a render pass + presents the swap chainCreates 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§

GenericSurfaceError
A ready-made, string-backed SurfaceError for 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.
RecoverableError
A surface-lifecycle error that can optionally signal whether it’s worth retrying.
WindowHandle
A window/display handle pair, as one trait.

Functions§

cell_art_glyph
The glyph a Presenter should paint art (a bitmap-font glyph or a tileset sprite) for, or None when this cell draws none.