Expand description
Desktop development and preview backend for Denise.
This backend exists so the core abstraction can be proven — and iterated on — without a Raspberry Pi on the desk. It is not a deployment target: shipping Denise on a desktop means shipping a compositor you did not need.
Pixels come from the software rasteriser into a buffer the compositor
uploads — or, behind the gpu feature and Present::Gpu, from
denise-wgpu into a swapchain. The second is for the designer on a large
display; an application chooses it per window and draws through
DeniseApp::paint, which is the same call on either path.
use denise::{Color, DamageTracker, Frame, InputEvent, Rect};
use denise_render::Canvas;
use denise_winit::{DeniseApp, WindowConfig, run};
struct Hello;
impl DeniseApp for Hello {
fn update(&mut self, _events: &[InputEvent], _damage: &mut DamageTracker) {}
fn render(&mut self, frame: &mut Frame<'_>, damage: &[Rect]) {
let mut canvas = Canvas::new(frame);
for region in damage {
canvas.with_clip(*region).clear(Color::from_rgb888(0x1E1E2E));
}
}
}
run(WindowConfig::default(), Hello).unwrap();Structs§
- GpuSurface
- A winit window drawn into through
denise-wgpu. - Waker
- Wakes a running loop from any thread, so every window is asked for a frame as soon as one can be drawn.
- Window
Config - How the preview window is created.
- Window
Request - A window the application wants opened, and the application that will run in it.
- Winit
Surface - A resizable window surface backed by a persistent shadow buffer.
Enums§
- Error
- Failures from this backend.
- Modality
- How a secondary window relates to the one that opened it.
- Present
- What draws a window’s pixels.
Traits§
- Denise
App - An application driven by this backend.