README.md

June 16, 2026 · View on GitHub

Caution: Due to certain reasons, this repository will be renamed to imguinz2 in a few days.

After the repository is renamed to imguinz2, navigate to your dear_bindings_build project folder in the terminal or command prompt and run the following command once:

git remote set-url origin https://github.com/dinau/imguinz2.git

Alternatively, you can simply perform a fresh clone of the new URL:

https://github.com/dinau/imguinz2.git

ImGuinz2

This project aims to simply and easily build Dear ImGui examples with C and Zig using Dear_Bindings as first step. And one can use many other libaries and examples with less external dependencies (Except Raylib library).

DearBindings: dear_bindings_v0.18_ImGui_v1.92.8-docking
Dear ImGui: 1.92.8 dock (2026/06)

Zig fetch


Use zig-0.16.0

  1. Zig fetch imguinz2

    mkdir myapp
    cd myapp
    zig init
    
    zig fetch --save git+https://github.com/dinau/imguinz2
    
  2. Add dependencies to build.zig
    Please insert the following lines above b.installArtifact(exe);.

    const imguinz2 = b.dependency("imguinz2", .{});
    const dependencies = .{
        "appimgui",      // Simple app framework
        "imspinner",     // ImSpinner
        "imknobs",       // ImKnobs
        "imtoggle",      // ImToggle
     // "another_lib",
    };
    inline for (dependencies) |dep_name| {
        const dep = imguinz2.builder.dependency(dep_name, .{
            .target = target, 
            .optimize = optimize, 
        });
        exe.root_module.addImport(dep_name, dep.module(dep_name));
    }
    exe.subsystem = .Windows; // Hide console window
    

    You can set dependencies (additional libraries), see imguinz2/build.zig.zon

    "appimgui"     <- Simple app framework for GLFW and OpenGL backend
    "imspinner"    <- ImSpinner
    "imguizmo"     <- ImGuizmo
    "imknobs"      <- ImKnobs 
    "imnodes"      <- ImNodes
    "implot"       <- ImPlots
    "implot3d"     <- ImPlot3D
    "imtoggle"     <- ImToggle
    "rlimgui"      <- rlImgui
    ... snip  ...
    
  3. Edit src/main.zig

    const app = @import("appimgui");
    const ig = app.ig;
    const spinner = @import("imspinner"); // ImSpinner
    const knobs = @import("imknobs"); // ImKnobs
    const tgl = @import("imtoggle"); // ImToggle
    
    // gui_main()
    pub fn gui_main(window: *app.Window) void {
        var col: f32 = 1.0;
        var fspd: bool = false;
        var speed: f32 = 2.0;
        var spn_col: spinner.ImColor = .{ .Value = .{ .x = col, .y = 1.0, .z = 1.0, .w = 1.0 } };
        while (!window.shouldClose()) { // main loop
            window.pollEvents();
            window.frame(); // Start ImGui frame
    
            ig.ImGui_ShowDemoWindow(null); // Show ImGui demo window
    
            ig.ImGui_SetNextWindowSize(.{ .x = 0.0, .y = 0.0 }, 0); // Fit window size depending on the size of the widgets
            _ = ig.ImGui_Begin("Demo", null, 0); // Show demo window
            spinner.SpinnerAtomEx("atom", 16, 2, spn_col, speed, 3);
            ig.ImGui_SameLine();
            _ = tgl.Toggle("Speed", &fspd, .{ .x = 0.0, .y = 0.0 });
            if (fspd) speed = 6.0 else speed = 2.0;
            if (knobs.IgKnobFloat("Color", &col, 0.0, 1.0, 0.05, "%.2f", knobs.IgKnobVariant_Stepped, 0, 0, 10, -1, -1)) {
                spn_col.Value.x = col;
            }
            ig.ImGui_End();
    
            window.render(); // render
        } // end while loop
    }
    
    pub fn main() !void {
        var window = try app.Window.createImGui(1024, 900, "ImGui window in Zig");
        defer window.destroyImGui();
    
        _ = app.setTheme(.dark); // Theme: dark, classic, light, microsoft
    
        gui_main(&window); // GUI main proc
    }
    
  4. Build and run

    pwd
    myapp
    
    zig build run     # or zig build --release=fast
    
    

    myapp.png

Try Wasm demo in your browser


Click link for live demo: Click here
alt

Frontends and Backends


FrontendsBackends
GLFW3OpenGL3
SDL3OpenGL3, SDL3GPU
Win32DirectX 11(D3D11)

Prerequisites


Available libraries list at this moment


LibraryC WrapperDate
YESDear ImGuiDear_Bindings2024/06
YESImGui-KnobsCImGui-Knobs2025/07
YESImGuiFileDialogCImGuiFileDialog2025/07
YESImGui_ToggleCimGui_Toggle2025/07
YESImSpinnerCImSpinner2025/07
YESImGuiColorTextEditcimCTE2025/08
YESImGuizmoCImGuizmo2025/08
YESImNodesCImNodes2025/08
YESImPlotCImPlot2025/08
YESImPlot3dCImPlot3d2025/08
YESimgui_zoomable_imagecimgui_zoomable_image2026/04
WIPImGui_MarkdownCImGui_MarkDown-
YESSTB-
YESFont-Awesome-

Additional examples

Build and run


git clone https://github.com/dinau/imguinz2

cd imguinz2/examples/zig_glfw_opengl3       # for example
zig build run --release=fast                # or make run

Examples screen shots

zig_imknobs

zig_imknobs

alt

zig_imtoggle

zig_imtoggle

alt

zig_imspinner

zig_imspinner

alt

Raylib example

First fetch raylib,

zig fetch --save git+https://github.com/raysan5/raylib

raylib_basic

alt

raylib_cjk: Showing multi byte(CJK) fonts

alt

Raylib + ImGui + rlImGui

First fetch raylib,

zig fetch --save git+https://github.com/raysan5/raylib

main.zig

alt

zig_imfiledialog

zig_imfiledialog

alt

zig_imgui_markdown

  • Work in progress

zig_imgui_markdown

alt

zig_iconfontviewer

zig_iconfontviewer

  • Incremantal search
  • Magnifing glass

alt

zig_imcolortextedit

zig_imcolortextedit

alt

zig_imguizmo

zig_imguizmo

alt

zig_imnodes

zig_imnodes

alt

zig_implot / zig_implot3d

zig_implot / zig_implot3d

zig_imPlotDemo written in Zig.

alt
alt

Image load / save (OpenGL, SDL3, SDL3GPU)

LanguageGLFWMagnifing glassImage load /saveNote
Cglfw_opengl3_image_load-Y
Cglfw_opengl3_image_save-Y
Zigzig_glfw_opengl3_image_loadYY
Zigzig_sdl3_sdlgup3 / zig_sdl3_opengl3-loadDownload SDL3.dll on Windows
  • Image file captured will be saved in current folder.
  • Image format can be selected from JPEG / PNG / BMP / TGA.

alt

zig_glfw_opengl3

  • Basic example
LanguageGLFWSDL3
Cglfw_opengl3, glfw_opengl3_jpsdl3_opengl3
Zigzig_glfw_opengl3zig_sdl3_opengl3

alt alt

zig_imgui_zoomable_image

Try Wasm live demo in your browser
Click link for live demo: Click here

alt

Hiding console window


  • Zig examples
    Open build.zig in each example folder and enable the option line as follows,

    ... snip ...
    exe.subsystem = .Windows;  // Hide console window
    ... snip ...
    

    and execute make.

  • C examples
    Open Makefile in each example folder and change the option line as follows,

    ... snip ...
    HIDE_CONSOLE_WINDOW = true
    ... snip ...
    

    and execute make.

SDL libraries


https://github.com/libsdl-org/SDL
https://github.com/libsdl-org/SDL/releases

My tools version


  • make: GNU Make 4.4.1
  • Python 3.14.3

Similar project ImGui / CImGui


LanguageProject
LuaScriptLuaJITImGui
NeLuaCompilerNeLuaImGui / NeLuaImGui2
NimCompilerImGuin, Nimgl_test, Nim_implot
PythonScriptDearPyGui for 32bit WindowsOS Binary
RubyScriptigRuby_Examples
ZigCompilerImGuinZ with CImGui
Zig, CCompilerImGuinZ2 with Dear Binindings

SDL game tutorial Platfromer


ald

LanguageSDLProject
LuaJITScriptSDL2LuaJIT-Platformer
NeluaCompilerSDL2NeLua-Platformer
NimCompilerSDL3 / SDL2Nim-Platformer-sdl2/ Nim-Platformer-sdl3
RubyScriptSDL3Ruby-Platformer
ZigCompilerSDL3 / SDL2Zig-Platformer

Footnotes

  1. Except Raylib and win32_dx11 examples