From 8a8d7d13de1f52c09e94f80e6bf9111113de1f82 Mon Sep 17 00:00:00 2001 From: Kangming Deng Date: Mon, 28 Sep 2026 18:50:37 -0400 Subject: [PATCH 1/3] chore: add `zig-pkg/` to `.gitignore` --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 93d4754..50bb5f5 100644 --- a/.gitignore +++ b/.gitignore @@ -145,6 +145,7 @@ xcuserdata/ ### Zig template .zig-cache/ zig-out/ +zig-pkg/ ### Node template # Logs From 83b1afabdd141bbe210afb59ecc0301521b34c82 Mon Sep 17 00:00:00 2001 From: Kangming Deng Date: Mon, 28 Sep 2026 18:53:01 -0400 Subject: [PATCH 2/3] chore: add [raylib-zig](https://github.com/raylib-zig/raylib-zig) --- build.zig | 13 +++++++++++++ build.zig.zon | 41 ++++------------------------------------- 2 files changed, 17 insertions(+), 37 deletions(-) diff --git a/build.zig b/build.zig index 4a73511..c2346e0 100644 --- a/build.zig +++ b/build.zig @@ -83,6 +83,19 @@ pub fn build(b: *std.Build) void { }), }); + const raylib_dep = b.dependency("raylib_zig", .{ + .target = target, + .optimize = optimize, + }); + + const raylib = raylib_dep.module("raylib"); + const raygui = raylib_dep.module("raygui"); + const raylib_artifact = raylib_dep.artifact("raylib"); + + exe.root_module.linkLibrary(raylib_artifact); + exe.root_module.addImport("raylib", raylib); + exe.root_module.addImport("raygui", raygui); + // This declares intent for the executable to be installed into the // install prefix when running `zig build` (i.e. when executing the default // step). By default the install prefix is `zig-out/` but can be overridden diff --git a/build.zig.zon b/build.zig.zon index 76d83f2..9286e26 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -32,44 +32,11 @@ // Once all dependencies are fetched, `zig build` no longer requires // internet connectivity. .dependencies = .{ - // See `zig fetch --save ` for a command-line interface for adding dependencies. - //.example = .{ - // // When updating this field to a new URL, be sure to delete the corresponding - // // `hash`, otherwise you are communicating that you expect to find the old hash at - // // the new URL. If the contents of a URL change this will result in a hash mismatch - // // which will prevent zig from using it. - // .url = "https://example.com/foo.tar.gz", - // - // // This is computed from the file contents of the directory of files that is - // // obtained after fetching `url` and applying the inclusion rules given by - // // `paths`. - // // - // // This field is the source of truth; packages do not come from a `url`; they - // // come from a `hash`. `url` is just one of many possible mirrors for how to - // // obtain a package matching this `hash`. - // // - // // Uses the [multihash](https://multiformats.io/multihash/) format. - // .hash = "...", - // - // // When this is provided, the package is found in a directory relative to the - // // build root. In this case the package's hash is irrelevant and therefore not - // // computed. This field and `url` are mutually exclusive. - // .path = "foo", - // - // // When this is set to `true`, a package is declared to be lazily - // // fetched. This makes the dependency only get fetched if it is - // // actually used. - // .lazy = false, - //}, + .raylib_zig = .{ + .url = "git+https://github.com/raylib-zig/raylib-zig?ref=devel#8758f4cd3a5ae0df6941c4715257223d34c5ad3e", + .hash = "raylib_zig-6.0.0-KE8RECZ8BQDm-txuospkpZHbJ6DNpacUF7D88RWQ_qAe", + }, }, - // Specifies the set of files and directories that are included in this package. - // Only files and directories listed here are included in the `hash` that - // is computed for this package. Only files listed here will remain on disk - // when using the zig package manager. As a rule of thumb, one should list - // files required for compilation plus any license(s). - // Paths are relative to the build root. Use the empty string (`""`) to refer to - // the build root itself. - // A directory listed here means that all files within, recursively, are included. .paths = .{ "build.zig", "build.zig.zon", From c97dbd422dc2b128e5222f82013be6e0b9e66d5f Mon Sep 17 00:00:00 2001 From: Kangming Deng Date: Mon, 28 Sep 2026 18:53:36 -0400 Subject: [PATCH 3/3] feat: init raylib window --- src/main.zig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main.zig b/src/main.zig index 89bff2a..805663c 100644 --- a/src/main.zig +++ b/src/main.zig @@ -3,8 +3,22 @@ const process = std.process; const Init = process.Init; const c6 = @import("connect6"); +const rl = @import("raylib"); + +const title = "Connect6"; pub fn main(init: Init) !void { var game = try c6.Game.init(init.gpa, .square(19)); defer game.deinit(); + + rl.initWindow(800, 600, title); + defer rl.closeWindow(); + rl.setTargetFPS(60); + + while (!rl.windowShouldClose()) { + rl.beginDrawing(); + defer rl.endDrawing(); + rl.clearBackground(.white); + rl.drawText(title, 36, 30, 24, .black); + } }