zest-simulator
zest-simulator is the desktop Platform implementation for the zest GUI framework family.
It renders with tiny-skia into an RGBA pixmap, converts the output to Rgb565, and displays it through embedded-graphics-simulator and SDL2.
The simulator implements zest_core::Platform<Color = Rgb565>.
What it provides
SimulatorPlatformSimulatorPlatformBuilder- default desktop settings for a 320×240 RGB565 display
- SDL-backed event polling
- touch-style input through mouse press / move / release
- keyboard input mapped into
KeyEvent - mouse-wheel input mapped into
EncoderEvent - dirty-region rendering support
- optional dirty-rectangle overlay output
Defaults
The crate exports these defaults:
DEFAULT_WIDTH = 320DEFAULT_HEIGHT = 240DEFAULT_SCALE = 2DEFAULT_PIXEL_SPACING = 0DEFAULT_POLL_MS = 16
Basic usage
use SimulatorPlatform;
let platform = new;
For custom configuration, use the builder:
use Size;
use SimulatorPlatform;
let platform = builder
.size
.scale
.pixel_spacing
.poll_ms
.show_dirty
.build;
Input mapping
The simulator maps SDL events into zest-core input types:
- left mouse button down / move / up →
TouchEvent - supported keyboard keys →
KeyEvent - mouse wheel →
EncoderEvent
Rendering behavior
The simulator reports clipping and partial-flush support through PlatformCapabilities.
It implements both:
render_with(...)render_with_dirty(...)
When show_dirty(true) is enabled, the simulator outlines dirty rectangles after partial redraws.
Notes
- The simulator is fixed to
Rgb565. - The crate uses
std. - It is intended for desktop development and debugging, not embedded deployment.