How to use C2Z to integrate Dear IMGUI into a Zig application
- Binding generator for C++, but it can also transpile some inline functions and template classes
- It has a zig implementation for
std::vector
andstd::string
, so no opaque pointers
zig 0.11.0-dev.3220+447a30299
is the only requirement- clone from https://github.com/lassade/c2z, here I'm using the commit
3d0a7c9
- build it using
zig build
- copy
zig-out\c2z.exe
to your path or program folder
- run
c2z -- -DIMGUI_DISABLE_OBSOLETE_KEYIO -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS .\lib\imgui\imgui.h
to generate the first set of bindings c2z
is meant automate 90% of the work, the other 10% is with you
- regenerate bindings for the current version
- generate a bindings for newest version
- compare both of them (I like to use
WinMerge
) - copy the relevant data