summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-12 01:38:36 -0300
committerGabriel Schneider <[email protected]>2026-11-12 13:22:02 -0300
commit91a34124880d932f97718b959b11bc5375c0dd79 (patch)
treef45caba09aa93b55a898fc938810e489048cbfad
parent1f388721fcc8d89026c9c3b235c33bd511646885 (diff)
downloadsketchbook-91a34124880d932f97718b959b11bc5375c0dd79.tar.gz
sketchbook-91a34124880d932f97718b959b11bc5375c0dd79.zip
frame: a library's own state for the frame
canim keeps its table of places on the frame rather than in a process global, so two players at once each have their own. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
-rw-r--r--src/sketch/root.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sketch/root.zig b/src/sketch/root.zig
index 81ebad5..b2f9136 100644
--- a/src/sketch/root.zig
+++ b/src/sketch/root.zig
@@ -73,6 +73,9 @@ pub const Frame = struct {
session: std.mem.Allocator,
/// For Store: on disk, across restarts.
store: std.mem.Allocator,
+ /// A library's own state for this frame (canim's table of places), in
+ /// `scratch`: null at each frame's start.
+ user: ?*anyopaque = null,
pub fn init(ctx: *const abi.Context) Frame {
return .{ .ctx = ctx, .in = ctx.input, .host = ctx.host, .scratch = ctx.scratch, .session = ctx.session, .store = ctx.store };