summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md13
1 files changed, 9 insertions, 4 deletions
diff --git a/README.md b/README.md
index 6531fcd..62e5ab1 100644
--- a/README.md
+++ b/README.md
@@ -39,7 +39,9 @@ An app is an ordinary module. Every declaration is optional:
`update` sees `input.events`: pointer, wheel, key, text, `cancel` (focus loss,
console) and one `tick` per frame carrying `dt`. Recorded ticks make
-time-driven sketches replay exactly.
+time-driven sketches replay exactly. `input.started` is true on the first update after
+the program starts, never after a reload: state is saved, so this is where
+to stop what should not resume on its own.
`draw` gets a `Frame`: `clear`, `fill`, `image`, `text`, `print`, `clip`,
`canvas`, `cursor`, `voice`, `audio`, `pixels`, `quit`, plus `f.arena` (frame
@@ -95,7 +97,10 @@ queued and played.
sketch.
- **Scripts** (`--headless --fresh --script file`) drive the same routing and
frames as a player: `click`, `key`, `type`, `console`, `expect field value`,
- `expect-audio`, `screenshot`, `load`, `await-reload`.
+ `expect-audio`, `screenshot`, `load`, `reload`, `await-reload`. A failed
+ `expect`, or a console line that errors (a sketch command returning an
+ error included), fails the script. Headless always means offscreen, even
+ with `SDL_VIDEO_DRIVER` set, and GPU work still runs, into a texture.
- **GPU.** The host's 2D renderer runs on an SDL GPU device, which also
runs sketches' GPU passes. Without a GPU it falls back to any renderer.
- **Memory.** SDL allocations go through a leak-checking allocator; a leak
@@ -121,9 +126,9 @@ pub fn build(b: *std.Build) void {
| --- | --- |
| `app.addLibrary()` | the hot-reloadable shared library |
| `app.addExecutable()` | host and sketch linked into one binary |
-| `app.addWeb(.{ .assets = ... })` | the wasm module and a ready-to-serve directory |
+| `app.addWeb(.{ .assets = ... })` | the wasm module and a ready-to-serve directory; tests can read its state by path with `sk_field` (numbers) and `sk_tag` (enum tag names) |
| `app.addRun(lib, .{})` | the generic host running the installed library |
-| `app.addScript(exe, file, .{})` | a headless, fresh-state scripted run |
+| `app.addScript(exe_or_lib, file, .{})` | a headless, fresh-state scripted run, of the executable or of the library through the host (so the script can `reload` it) |
| `app.addProbe(state)` | the probe on a state file |
| `app.addTest(.{})` | tests with the app importable as `app` |