Raylib example using the package manager

I managed to get raygui to work alongside raylib by downloading the single raygui header file.

I added it as a local dependency in the build.zig.zon:

.raygui = .{
            .path = "vendor/raygui", // contains the raygui.h
        },

build.zig:

const raygui_dep = b.dependency("raygui", .{
        .target = target,
        .optimize = raylib_optimize,
    });
    exe.addIncludePath(raygui_dep.path(""));

raylib.zig:

pub usingnamespace @cImport({
    @cInclude("raylib.h");
    @cInclude("raymath.h");
    @cInclude("rlgl.h");
    @cDefine("RAYGUI_IMPLEMENTATION", {});
    @cInclude("raygui.h");
});
2 Likes