summaryrefslogtreecommitdiff
path: root/src/host/Timing.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 09:35:51 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit3373059db38e3b0bbf6105e91180300a4f1c6ead (patch)
tree5e95ff0f5e471c57705c7820ea3b015d9a0463c7 /src/host/Timing.zig
parentae807468f15e81ea3b62fee4741ee6b246e6df8b (diff)
downloadsketchbook-3373059db38e3b0bbf6105e91180300a4f1c6ead.tar.gz
sketchbook-3373059db38e3b0bbf6105e91180300a4f1c6ead.zip
examples/live: the canvas is the window's pixels, so the code is sharp
With a GPU the canvas is an offscreen texture at canvas pixels, which the host scales (linearly) to the window: the demo's fixed 1280x720 in a larger window drew its code at 16 px and showed it blurred. `draw` sets the canvas to the room the host has (`window_width`/`height`, at least 640x360), so a glyph lands on a whole pixel of the display at any window size, and lays out by it: the picture fills it, the scope sits at its bottom, the mode and time at its right. The picture is drawn at most 720 rows high (half that past 64 instructions, as before) and scaled up, so a large window costs the GPU what 1280x720 did; square units hold, as its width follows the room's aspect. Headless the room is the canvas unless `--size` gives one, so every test picture is the one before, pixel for pixel. The display here is a 3840x2160 screen at scale 1, where this is all device-sharp needs; at a density of 2 the window is not asked for its pixels (SDL_WINDOW_HIGH_PIXEL_DENSITY), so the compositor scales it: a change to the host, not to the demo. zig build test: 92 of 92 steps. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'src/host/Timing.zig')
0 files changed, 0 insertions, 0 deletions