examples: add textured-cube example
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
f8e7f96a4a
commit
d0d0db8725
6 changed files with 383 additions and 7 deletions
17
build.zig
17
build.zig
|
|
@ -34,6 +34,7 @@ pub fn build(b: *std.build.Builder) void {
|
|||
.{ .name = "two-cubes", .packages = &[_]Pkg{Packages.zmath} },
|
||||
.{ .name = "instanced-cube", .packages = &[_]Pkg{Packages.zmath} },
|
||||
.{ .name = "advanced-gen-texture-light", .packages = &[_]Pkg{Packages.zmath} },
|
||||
.{ .name = "textured-cube", .packages = &[_]Pkg{ Packages.zmath, Packages.zigimg } },
|
||||
}) |example| {
|
||||
const example_exe = b.addExecutable("example-" ++ example.name, "examples/" ++ example.name ++ "/main.zig");
|
||||
example_exe.setTarget(target);
|
||||
|
|
@ -79,13 +80,15 @@ const ExampleDefinition = struct {
|
|||
};
|
||||
|
||||
const Packages = struct {
|
||||
const zmath = zmath_pkg;
|
||||
};
|
||||
|
||||
// Declared here because submodule may not be cloned at the time build.zig runs.
|
||||
const zmath_pkg = std.build.Pkg{
|
||||
.name = "zmath",
|
||||
.path = .{ .path = "examples/libs/zmath/src/zmath.zig" },
|
||||
// Declared here because submodule may not be cloned at the time build.zig runs.
|
||||
const zmath = std.build.Pkg{
|
||||
.name = "zmath",
|
||||
.path = .{ .path = "examples/libs/zmath/src/zmath.zig" },
|
||||
};
|
||||
const zigimg = std.build.Pkg{
|
||||
.name = "zigimg",
|
||||
.path = .{ .path = "examples/libs/zigimg/zigimg.zig" },
|
||||
};
|
||||
};
|
||||
|
||||
pub const pkg = std.build.Pkg{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue