Same facts in fewer words across README, CLAUDE.md, CONTRIBUTING, DOCUMENTATION, FAQ, DEMO and NOTICE, and the claims that had drifted from the code brought back in line: - CI runs eleven console tests from tools/ci/tests.txt, plus the scripted uitest, skiptest and damagetest; the Tests table lists the last two. - Linux ARMv7 and RISC-V build on every pull request, emulated and allowed to fail, not only on master. - CONTRIBUTING runs the tests from tools/ci/tests.txt instead of an old list. - The showcase is about 4,600 lines and notepad about 410. - The shared library also ships as -macos-universal. - SDL's GPU API is built only with REAKTOR_SHADERS. - The architecture list names core/sdl and damage drawing. - CLAUDE.md: --shot also hides partial redraws; damagetest catches them. - PLAN.md is marked finished, with what has changed since. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5.8 KiB
Reaktor
C99. Widgets are declared; the look comes from CSS read at runtime.
Build and run
./build.sh [target] (./build.ps1 on Windows, which finds cmake; it is
not on PATH). Targets: showcase, notepad, simple, bench, the tests
in tests/, and libreaktor. -Arch x86|arm64 builds into build-<arch>;
ARM64 is checked only by CI.
CMake options pass through: ./build.ps1 -DREAKTOR_A11Y=OFF,
./build.sh -- -DREAKTOR_A11Y=OFF. The cache keeps them; pass =ON to switch
back. Check build/CMakeCache.txt before measuring: REAKTOR_SHARED=ON left
in build/ links every sample shared.
Shipping: tools/package.sh packs a release folder, tools/libreaktor-pkg.sh
a system package (libreaktor static; with -s, libreaktor1,
libreaktor-sdl3-0 and libreaktor-shared). A version tag such as 1.2.3
publishes through release.yml.
Verify against pixels, not source
Reasoning about what a dependency will draw has been wrong too often. Take the screenshot and diff the dump:
./build/showcase --tab 7 --theme dark --shot a.bmp --a11y-dump a.txt
The dump has a line per node with role, name, value, state and bounds, so a
one-pixel move shows. Lines marked volatile (Diagnostics timings) differ
every run.
Traps that have cost real time
- A rule cannot resize a box the page sized.
.box = { .h = N }locks CSS out of that axis; usually why a stylesheet "only changes the color". core/ui/style_map.cis the only writer ofnk_style. Anything set elsewhere is lost on the next theme change.- A box is placed one frame late and found by its name. A widget whose
label changes every frame needs a stable
.name. - Hover redraws only across a hot rectangle. Motion runs a frame only when
it crosses a rectangle
hot_pushregistered the frame before. - A percentage is not a length to
core/css/css.c.width: 100%is dropped and a lower rule shows through.[type=range]reads asinput.type-range. - Vertices snap to whole pixels. Sub-pixel corrections vanish; abutting rects can round apart into a seam.
- SDL's software renderer redraws rectangles its own way, truncating
position and size apart at fractional scales.
nk_sdl_quaddraws them from device pixels first. - A one-pixel stroke is two pixels.
nk_stroke_rectcasts toshortand anti-aliasing splits it. Borders arereaktor_edge_round: a ring mask for corners, runs cut from its middle texels. - Rounded fills are masks. Fill anti-aliasing is off on the software
renderer, so
reaktor_renderswaps each rounded fill forreaktor_fill_round, relinking the command list (it ends where anextreachesctx->memory.allocated). - SDL draws when it flushes, not when it is asked. Its calls only queue,
so without a GPU most of a frame is the flush the runtime makes before
timing the present; the Diagnostics page and
bench --no-vsyncsplit them. Vsync sits in the present: a total matching the refresh rate measures it. --shotnever skips a frame. It and a capture force a whole draw, so a pixel diff cannot see what skipping an unchanged frame, or redrawing only what changed, breaks;tests/skiptest.candtests/damagetest.ccan. Skipping is the default;.draw_every_frameturns it off.- Text the atlas lacks is not Nuklear's. Strings with Japanese, Arabic and
the like are measured and drawn by
core/text/text.cthrough a custom command. mojibake 0.5.0 recordsbyte_offsetat a character's last byte. - Only Nuklear's active window gets input. Others carry a sticky
NK_WINDOW_ROM. A layer that must not take input usesreaktor_layer_beginwithHOLD_ALL;reaktor_layer_focushands focus back. - A field's keys are its own. Edit state lives on the widget's window, so
navigation asks
app->editingbefore taking arrows, Home, End, Enter or Space. The runtime keeps Home and End, which would scroll the panel. - A field's value is not its buffer.
nk_edit_stringleaves bytes past the length; a length not from the field's own last frame reseeds it empty. - An empty edit has no text pointer.
nk_str_get_constis NULL whilenk_str_len_charis positive. - Web: a tap focuses the canvas. Only canceling the touch
pointerdownstops it. - Web: SDL delivers events a frame late, so the page's own typing goes through SDL's queue to keep its order.
- Web: a hidden page runs no frames. A background tab fires no
requestAnimationFrame, so the canvas and a11y tree stay empty. Checkdocument.visibilityState. - The shared library exports only
tools/reaktor.map. A new public call goes in the map, orcheck-exports.shfails; a struct an app sees that changes needs a new SOVERSION andcheck-abi.sh -u. OpenBSD installs no unversionedlibreaktor.so.
House rules
- Dependencies are submodules under
external/, used as they ship. Never copy a value out of one or generate a header from one. The exception isREAKTOR_BUILTINSin CMakeLists.txt: Water.css's palettes andsrc/parts/, the seven Ionicons the widgets draw, the Aileron fonts, the mark and reaktor.css, compiled in byte for byte. SDL is built withcore/sdl/no_dynapi.h; NOTICE.md says why. - Applications see only
include/reaktor/;Appis opaque. What a sample needs becomes a public call. MSVC treats implicit declarations as errors. - American English.
- No environment variables: overrides are command-line flags the runtime
strips from
argv. docs/DOCUMENTATION.mdis the only manual;PERFORMANCE.mdholds measured numbers only, with the machine named.- An optional module is an interface library plus a
_nonetwin, switched byREAKTOR_<NAME>(defaultON). Off, pixels and--a11y-dumpmust not change beyond what the module draws. Localization and text shaping are separate modules.