Skip to main content

Crate pixel8_console

Crate pixel8_console 

Source
Expand description

The Pixel8 console as a library: the shell (boot prompt, mode machine, run loop), the five editors, build orchestration and web export — everything except presentation and input, which each frontend supplies.

Two frontends drive it: the pixel8 binary in this crate — whose windowed frontend (winit + wgpu) sits behind the default-on window feature, while its headless subcommands always build — and the pixel8-tui crate (sixel/half-block terminal rendering). Frontends that don’t want the GPU stack depend on this crate with default-features = false; everything a frontend needs — ticking the shell::Shell, feeding it keys and mouse state, presenting the framebuffer it draws — is exported here.

Modules§

builder
Building carts: run cargo build --target wasm32-unknown-unknown on a project, in the background, and report the result to the console.
gpu
GPU presentation: upload the 128x128 indexed framebuffer as an RGBA texture and blit it with nearest-neighbor filtering at the largest integer scale that fits, letterboxed in black. The GPU does nothing clever on purpose — every pixel is decided by the software rasterizer.
shell
The console shell: boot screen, command prompt, mode switching, the run loop, build orchestration and error screens. If Pixel8 has a personality, it lives here.
ui
Editor chrome shared by all modes: the red tab bar, the status bar, mouse state and the cursor. Everything is drawn with the runtime’s fantasy-console primitives — no native widgets anywhere.
webexport
Web export: turn a cart into a single self-contained HTML file.

Functions§

frame_duration
One tick’s wall-clock budget at a given rate (30 normally, 60 while a 60 fps cart runs).
sdk_path
Where the pixel8 SDK crate lives, for generated project manifests. Defaults to this source tree; override with PIXEL8_SDK for installs.