Add Dear ImGui internal, and cimgui_docking Zig module.#5
Conversation
|
Ok, @dom3d this is my alternative attempt. There's 2 Zig modules This is how it works in the upstream project (by selectin between docking and non-docking via floooh/sokol-zig-imgui-sample#3 E.g. the build.zig: https://github.com/floooh/sokol-zig-imgui-sample/blob/imgui-docking/build.zig ...and the demo code: https://github.com/floooh/sokol-zig-imgui-sample/blob/imgui-docking/src/main.zig I don't access any internal API in this demo though. The important part in the build zig is this: E.g. for injecting the cimgui C header path into the sokol C library it's important to not confuse the I may need to come up with a more fool-proof version later to select between the docking and non-docking version... |
|
PS: ok I added a helper function I'll probably merge all that stuff on Sunday evening or Monday. |
|
...I just went ahead and merged it already today ;) |
|
|
|
@kassane is that a blocker for the D bindings? The internal API is still in a separate C header (cimgui_internal.h), so I guess the D bindings can just ignore that and only run cimgui.h through the importC step? The other option might be to enable the C preprocessor define ...but I'll also write a Dear ImGui ticket, it looks wrong that the imgui_internal.h header depends on intrinsics (instead of only the implementation). |
|
Ah, it's used here in header as inline code: ...but still, using the |
Yeah! fixed in |
Bring CMakeLists.txt in line with build.zig by adding cimgui_internal.cpp to all library configurations. This was missing despite being part of the source list since PR floooh#5 (July 2025) which added internal API exposure. The build.zig correctly includes cimgui_internal.cpp in imgui_sources, but CMakeLists.txt was never updated to match. This affects CMake/fips users who would be missing internal API implementations. Changes: - Add src/cimgui_internal.cpp to both fips and non-fips imgui libraries - Add src-docking/cimgui_internal.cpp to both imgui-docking libraries
src/cimgui.handsrc-docking/cimgui.hcimgui_docking