/zimgui

Bindings in zig for [Dear ImGui](https://github.com/ocornut/imgui).

Primary LanguageZigMIT LicenseMIT

(incomplete) Zig Imgui bindings

Bindings in zig for Dear ImGui. These are hand written and incomplete for now, while I work on a c++ parser in a side project.

michel-z's ZGUI lib

For a more feature complete and less opinonated bindings, see https://github.com/michal-z/zig-gamedev/tree/main/libs/zgui

Usage

For complete example, see usage in zig-imgui-template.

Backend

Imgui doesnt do much on it own, it relies on a backend to handle rendering, and something to handle windows (and more). This repro has some code prepared for OpenGL3 as backend, and Glfw to handle windowing, via addBackendGlfwOpenGl3.

Example

const zimgui = @import("deps/zimgui/build.zig");

pub fn build(b: *Builder) void {
    var exe = ...;

    exe.addPackagePath("zimgui", "deps/zimgui/src/zimgui.zig");
    _ = zimgui.link(b, exe, .{.impl_opengl3 = true});

    exe.addPackagePath("zimgui_backend", "deps/zimgui/src/backend_glfw_opengl3.zig");
    addBackendGlfwOpenGl3(b, exe);

    ...
}