diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-16 18:04:21 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-16 18:04:21 -0300 |
| commit | e77b01d4b5504cea08a3f88cf8502897d868a1d3 (patch) | |
| tree | c8e643d234dd26d920cbc563bfa7f740febf1fc7 /tools | |
| parent | d3074636fff0fbcd5fd9b71c0c3b1c1f5c0c1285 (diff) | |
| download | sketchbook-e77b01d4b5504cea08a3f88cf8502897d868a1d3.tar.gz sketchbook-e77b01d4b5504cea08a3f88cf8502897d868a1d3.zip | |
Add glTF scene rendering, resource setup and 9P controls
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/gltf_bindings.zig | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/gltf_bindings.zig b/tools/gltf_bindings.zig new file mode 100644 index 0000000..59695d8 --- /dev/null +++ b/tools/gltf_bindings.zig @@ -0,0 +1,14 @@ +//! Host build tool: input glTF/GLB -> output Zig source, before app compilation. +const std = @import("std"); +const gltf = @import("gltf"); + +pub fn main(init: std.process.Init) !void { + var args = init.minimal.args.iterate(); + _ = args.skip(); + const input = args.next() orelse return error.ExpectedGltfPath; + const output = args.next() orelse return error.ExpectedZigPath; + const a = init.arena.allocator(); + const bytes = try std.Io.Dir.cwd().readFileAlloc(init.io, input, a, .limited(64 << 20)); + const source = try gltf.generate(a, bytes, input); + try std.Io.Dir.cwd().writeFile(init.io, .{ .sub_path = output, .data = source }); +} |
