diff options
Diffstat (limited to 'src/sketch')
| -rw-r--r-- | src/sketch/root.zig | 3 | ||||
| -rw-r--r-- | src/sketch/web.zig | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/sketch/root.zig b/src/sketch/root.zig index b2f9136..52f05b2 100644 --- a/src/sketch/root.zig +++ b/src/sketch/root.zig @@ -142,6 +142,9 @@ pub const Frame = struct { pub fn target(f: *Frame, img: Image) void { f.emit(.{ .target = img }); } + pub fn backdrop(f: *Frame, dst: Rect, fragment: []const u8, uniforms: []const u8) void { + f.emit(.{ .backdrop = .{ .dst = dst, .fragment = fragment, .uniforms = f.keep(u8, uniforms) } }); + } /// How the 2D commands after it blend, until the next `blend` or the /// frame ends (which goes back to `.alpha`). pub fn blend(f: *Frame, mode: BlendMode) void { diff --git a/src/sketch/web.zig b/src/sketch/web.zig index db9d9a8..3e102ad 100644 --- a/src/sketch/web.zig +++ b/src/sketch/web.zig @@ -232,7 +232,7 @@ fn Driver(comptime App: type) type { .open_file => |v| js.openFile(v.command.ptr, v.command.len, v.pattern.ptr, v.pattern.len), // Synthesised voices are not on the web yet; quitting a page // means nothing; `run` lines go after the frame. - .voice, .quit, .run => {}, + .voice, .quit, .run, .backdrop => {}, } } |
