diff options
Diffstat (limited to 'src/sketch/web.zig')
| -rw-r--r-- | src/sketch/web.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sketch/web.zig b/src/sketch/web.zig index a035117..804a4df 100644 --- a/src/sketch/web.zig +++ b/src/sketch/web.zig @@ -2,7 +2,7 @@ //! the imports below: drawing on a 2D canvas, GPU work on WebGPU, sound and //! the microphone on Web Audio, files through the page. State, `update` and //! `draw` are the same Zig as on native. There is no timeline, and nothing -//! persists: Store lasts as long as the page. +//! persists. const std = @import("std"); const abi = @import("abi"); const root = @import("root.zig"); @@ -84,8 +84,6 @@ fn Driver(comptime App: type) type { var ready = false; var state: G.State = undefined; var session: G.Session = undefined; - // No disk on the web: the store lasts as long as the page. - var store: G.Store = undefined; var events: [1024]abi.Event = undefined; var event_count: usize = 0; var input: abi.Input = .{}; @@ -107,9 +105,7 @@ fn Driver(comptime App: type) type { .input = &input, .scratch = scratch.allocator(), .session = gpa, - .store = gpa, .session_root = std.mem.asBytes(&session), - .store_root = std.mem.asBytes(&store), .commands = &commands, }; } @@ -117,7 +113,6 @@ fn Driver(comptime App: type) type { fn init() callconv(.c) void { G.defaults(.state, std.mem.asBytes(&state)); G.defaults(.session, std.mem.asBytes(&session)); - G.defaults(.store, std.mem.asBytes(&store)); input.width = G.description.width; input.height = G.description.height; if (input.window_width == 0) { @@ -420,6 +415,7 @@ fn Driver(comptime App: type) type { .newSound = newSound, .samples = samples, .readFile = readFile, + .appendFile = appendFile, .env = env, .clock = clock, }; @@ -484,6 +480,10 @@ fn Driver(comptime App: type) type { fn readFile(_: *anyopaque, _: []const u8) []const u8 { return &.{}; } + /// No files on the web: nothing is written, and the path is "". + fn appendFile(_: *anyopaque, _: [*]const u8, _: usize, _: [*]const u8, _: usize, _: bool) callconv(.c) [*:0]const u8 { + return ""; + } fn env(_: *anyopaque, _: []const u8) ?[]const u8 { return null; } |
