diff --git a/.gitmodules b/.gitmodules index 364119d5..3f522ce0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,9 +16,6 @@ path = examples/libs/zigimg url = https://github.com/slimsag/zigimg branch = zig-master -[submodule "examples/assets"] - path = examples/assets - url = https://github.com/hexops/mach-example-assets [submodule "freetype/upstream"] path = freetype/upstream url = https://github.com/hexops/freetype @@ -31,3 +28,12 @@ [submodule "sysaudio/upstream"] path = sysaudio/upstream url = https://github.com/hexops/soundio +[submodule "examples/image-blur/assets"] + path = examples/image-blur/assets + url = https://github.com/hexops/mach-example-assets +[submodule "examples/textured-cube/assets"] + path = examples/textured-cube/assets + url = https://github.com/hexops/mach-example-assets +[submodule "examples/gkurve/assets"] + path = examples/gkurve/assets + url = https://github.com/hexops/mach-example-assets diff --git a/build.zig b/build.zig index 8cbd301e..1a7e4a6e 100644 --- a/build.zig +++ b/build.zig @@ -54,7 +54,9 @@ pub fn build(b: *std.build.Builder) void { ensureGit(b.allocator); ensureDependencySubmodule(b.allocator, "examples/libs/zmath") catch unreachable; ensureDependencySubmodule(b.allocator, "examples/libs/zigimg") catch unreachable; - ensureDependencySubmodule(b.allocator, "examples/assets") catch unreachable; + ensureDependencySubmodule(b.allocator, "examples/gkurve/assets") catch unreachable; + ensureDependencySubmodule(b.allocator, "examples/image-blur/assets") catch unreachable; + ensureDependencySubmodule(b.allocator, "examples/textured-cube/assets") catch unreachable; inline for ([_]ExampleDefinition{ .{ .name = "triangle" }, diff --git a/examples/assets b/examples/gkurve/assets similarity index 100% rename from examples/assets rename to examples/gkurve/assets diff --git a/examples/gkurve/main.zig b/examples/gkurve/main.zig index 5469bc16..d9d5387d 100644 --- a/examples/gkurve/main.zig +++ b/examples/gkurve/main.zig @@ -59,7 +59,7 @@ pub fn init(app: *App, core: *mach.Core) !void { .rows_per_image = @intCast(u32, atlas_size.height), }; - const img = try zigimg.Image.fromMemory(core.allocator, @embedFile("../assets/gotta-go-fast.png")); + const img = try zigimg.Image.fromMemory(core.allocator, @embedFile("./assets/gotta-go-fast.png")); defer img.deinit(); const atlas_img_region = try app.texture_atlas_data.reserve(core.allocator, @truncate(u32, img.width), @truncate(u32, img.height)); diff --git a/examples/image-blur/assets b/examples/image-blur/assets new file mode 160000 index 00000000..b5a84047 --- /dev/null +++ b/examples/image-blur/assets @@ -0,0 +1 @@ +Subproject commit b5a8404715e6cfc57e66c4a7cc0625e64b3b3c56 diff --git a/examples/image-blur/main.zig b/examples/image-blur/main.zig index 35256713..bece3c33 100644 --- a/examples/image-blur/main.zig +++ b/examples/image-blur/main.zig @@ -83,7 +83,7 @@ pub fn init(app: *App, core: *mach.Core) !void { .min_filter = .linear, }); - const img = try zigimg.Image.fromMemory(core.allocator, @embedFile("../assets/gotta-go-fast.png")); + const img = try zigimg.Image.fromMemory(core.allocator, @embedFile("./assets/gotta-go-fast.png")); defer img.deinit(); const img_size = gpu.Extent3D{ .width = @intCast(u32, img.width), .height = @intCast(u32, img.height) }; diff --git a/examples/textured-cube/assets b/examples/textured-cube/assets new file mode 160000 index 00000000..b5a84047 --- /dev/null +++ b/examples/textured-cube/assets @@ -0,0 +1 @@ +Subproject commit b5a8404715e6cfc57e66c4a7cc0625e64b3b3c56 diff --git a/examples/textured-cube/main.zig b/examples/textured-cube/main.zig index 04ed2439..df6771c5 100644 --- a/examples/textured-cube/main.zig +++ b/examples/textured-cube/main.zig @@ -105,7 +105,7 @@ pub fn init(app: *App, core: *mach.Core) !void { .min_filter = .linear, }); const queue = core.device.getQueue(); - var img = try zigimg.Image.fromMemory(core.allocator, @embedFile("assets/gotta-go-fast.png")); + var img = try zigimg.Image.fromMemory(core.allocator, @embedFile("./assets/gotta-go-fast.png")); defer img.deinit(); const img_size = gpu.Extent3D{ .width = @intCast(u32, img.width), .height = @intCast(u32, img.height) }; const cube_texture = core.device.createTexture(&.{