Open Ldash4 opened 9 months ago
Oops, yeah, you're absolutely right - I'd somehow overlooked that use-case entirely. Thanks!
I've pushed an update now that parses imconfig.h
whilst generating the headers, and also includes any content it finds there in the JSON output. It also adds a --config-include
option so that custom configuration headers can be included if required.
Fingers crossed that solves the issue for you - if not the just let me know what's broken and I'll have another go at fixing it.
I may be doing something wrong, but I'm not seeing the output in the json. Repro:
a6143874
(probably doesn't matter)eec94ae
(latest as of writing)out/
imgui/imconfig.h
(I uncommented IMGUI_DISABLE_OBSOLETE_FUNCTIONS
)python dear_bindings/dear_bindings.py -o out/c_imgui imgui/imgui.h
IMGUI_DISABLE_OBSOLETE_FUNCTIONS
in out/c_imgui.json
. It cannot be found as a defineI just had a look and you're absolutely right, but that's actually due to a different "bug"... it seems the metadata doesn't include #defines that don't have a value.
What's more, it appears to have been deliberate (there was a comment explicitly stating that was what it was doing), but I have to admit I have absolutely no idea why I did that.
I can't think of any reason they shouldn't be in there (and, indeed the actual emit_define
code explicitly handles the case where there is no value present!), so I've updated the code to remove that check meaning that they should be included now.
Give that a try and let me know if it's still broken for you!
Unless I am missing something, it seems that changed defines in
imconfig.h
aren't available incimgui.json
. This is quite important for getting the bindings to be exactly compatible.