summaryrefslogtreecommitdiff
path: root/build.zig.zon
Commit message (Collapse)AuthorAge
* text: FreeType and HarfBuzz in the build, Pango, Cairo and glib out, glyphs ↵Gabriel Schneider6 days
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from one atlas build.zig.zon gains the freetype and harfbuzz packages pardes pins (lazy: a gpu-only embedder brings its own), and build.zig compiles them, with the flags pardes's window uses, together with pardes's vendor/font.c (unchanged) and a new vendor/text.c into one static library, sketchbook-text, which the host links. vendor/text.c replaces the Pango shim: the ten bundled faces by #embed, opened on first use by FreeType (font.c) and by HarfBuzz's own OpenType functions over the same bytes; sk_text_shape shapes a run left to right at a pixel size, each advance rounded to a whole pixel, with the line box font.c's cell metrics give; a codepoint the face lacks comes from one fallback face (ponytail: no fontconfig, no bidi); sk_text_font takes a sketch's own font from bytes. src/host/Glyphs.zig is the renderer: a text command is shaped at its canvas size, each glyph rastered by font.c's ui_font_raster at its device size and kept, trimmed to its ink (Atlas.inkBounds), in shelves of one 2048x2048 atlas, white premultiplied by coverage, cleared and refilled when full. Consecutive text commands are one SDL_RenderGeometry call; upright text lands on whole device pixels, NEAREST; textScaled (and a glyph past 512 device pixels) is unsnapped, LINEAR. The SDL debug font fallback off Linux goes: the faces are built in everywhere. Host.textSize measures with the same call. test/fonts.c (a Pango specimen outside the build) goes. Measured: a cold Debug build of the host 39.8 s before, 43.7 s after; the Debug host 117.7 MB (35.6 MB stripped) before, 159.5 MB (46.8 MB) after, with 6 shared libraries where it loaded 41 (pango, cairo, glib, fontconfig, the system freetype and harfbuzz and theirs). A frame of 4500 glyphs, half changing every frame (ReleaseFast, headless): 27.5 M instructions and 2.80 ms of CPU before, 5.33 M and 0.40 ms after; all static: 6.44 M and 0.47 ms before, 5.28 M and 0.42 ms after. zig build test: 192/192 steps, 146/146 tests; test/text.script's pinned pixels hold. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* Record every run's frames to a sessions database in xitdbGabriel Schneider6 days
| | | | | | | | | | | | | | | | | | | | | Live play was recorded only after someone typed record N, into 16 fixed slots. Now every run is a session in one xitdb database per sketch, beside its state file (<name>.xitdb): an append-only log of the frames live update was fed, one commit a second of session time, and keyframes of the State at start, every minute, on jumps, before and after reloads and at exit. A kill -9 loses at most the uncommitted second (test-kill). Whether a build records travels in the sketch: App.Options.record, null meaning Debug, reaching the host as Info.record. Scripted runs from fresh state record in memory, exports not at all. Each stretch of a session keeps its build, layout and Info.source: the repository revision (one jj or git call per build, build_info), zig version, backend and mode. Sessions.zig takes plain data (bytes, events, strings, a path, an Io), so a second host can drive it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* Add glTF scene rendering, resource setup and 9P controlsGabriel Schneider7 days
|
* sketchbook: a drawing layer on top, host fixes for replay and migrationGabriel Schneider11 days
|
* sketchbook: Zig 0.17, a Store on disk, requests, a scope (waveform, ↵Gabriel Schneider11 days
| | | | spectrum, spectrogram), audio codecs and fonts, web host
* Put the game first: lib/sketchbook, sketches/vecanimGabriel Schneider2026-09-25
The root is the game. The platform library moves to lib/sketchbook (with serve_web.py, which serves any sketch's web build, as a tool of it), and vecanim to sketches/vecanim, still its own package on the same library.