From e77b01d4b5504cea08a3f88cf8502897d868a1d3 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 16 Nov 2026 18:04:21 -0300 Subject: Add glTF scene rendering, resource setup and 9P controls --- tools/gltf_bindings.zig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tools/gltf_bindings.zig (limited to 'tools') 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 }); +} -- cgit v1.3