Snektron/vulkan-zig, generated for you, so that you can depend on it via the Zig package manager.
This is an experimental Mach library, according to our stability guarantees:
Experimental libraries may have their APIs change without much notice, and you may have to look at recent changes in order to update your code.
Status: Used in Mach so relatively stable, but you can consider using Snektron/vulkan-zig directly depending on your use case.
Create a build.zig.zon
file in your project (replace $LATEST_COMMIT
with the latest commit hash):
.{
.name = "mypkg",
.version = "0.1.0",
.dependencies = .{
.vulkan_zig_generated = .{
.url = "https://pkg.machengine.org/vulkan-zig-generated/$LATEST_COMMIT.tar.gz",
},
},
}
Run zig build
in your project, and the compiler instruct you to add a .hash = "..."
field next to .url
.
Then use the dependency in your build.zig
:
...
pub fn build(b: *Build) void {
...
exe.addModule("vulkan-zig-generated", b.dependency("vulkan_zig_generated", .{
.target = target,
.optimize = optimize,
}).module("vulkan_zig_generated"));
}
You may then const vk = @import("vulkan-zig-generated");
and use it.
For usage, see Snektron/vulkan-zig.
Issues are tracked in the main Mach repository.