mirror of
https://github.com/bdnugget/zig-gamedev.git
synced 2026-11-07 09:07:31 +00:00
zglfw v0.5.2 - GLFW bindings
Getting started
Copy zglfw and system-sdk folders to a libs subdirectory of the root of your project.
Then in your build.zig add:
const zglfw = @import("libs/zglfw/build.zig");
pub fn build(b: *std.Build) void {
...
const optimize = b.standardOptimizeOption(.{});
const target = b.standardTargetOptions(.{});
const zglfw_pkg = zglfw.package(b, target, optimize, .{});
zglfw_pkg.link(exe);
}
Now in your code you may import and use zglfw:
const zglfw = @import("zglfw");
pub fn main() !void {
...
}