Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImGUI wrapper #49

Merged
merged 3 commits into from
Jan 19, 2025
Merged

ImGUI wrapper #49

merged 3 commits into from
Jan 19, 2025

Conversation

kassane
Copy link
Owner

@kassane kassane commented Jan 14, 2025

Like zimgui:

Use D mangling in wrapped-functions.

Steps

  • comments
  • C functions
  • types (needed?)

References

Q: What is the status of D imgui bindings?

BindBC is known by the D community for its ease of interop with C and C++ libraries without static linking, just a dynamic loader.
However C++ interop is done manually without automatic generation prone to human error and slow progress.

"A much more sustainable version has reached a working state. I’m still not happy with some of the formatting but it’s available on my personal repository if you want to try it out. To use it you will have to build ImGui yourself as a library."

@kassane kassane added the enhancement New feature or request label Jan 14, 2025
@kassane kassane requested a review from floooh January 14, 2025 20:36
@kassane
Copy link
Owner Author

kassane commented Jan 14, 2025

zimgui is generated by dear_bindings without custom-prefix ig and cimgui add custom-prefix ig.

Unfortunately the script does not support D. Although the syntax is similar to C it requires some changes to the code generator.

Currently, to speed up the C => D translation process using importC use this command:

# Add C headers in source.c
$ ldmd2/ldc2 -P-I<c include> source.c -o- -Hf=source.d
  • -o-: no object generated
  • -Hf=: generate D file
  • -H: stdout print gen .di file, only -HC stdout print (D => C++)

I don't know if it would be interesting and practical to adapt or create a complementary script to translate code C => D, parsing and wrapped in dcimgui.

@kassane

This comment was marked as resolved.

@kassane

This comment was marked as off-topic.

@kassane

This comment was marked as resolved.

@kassane kassane mentioned this pull request Jan 17, 2025
@kassane kassane force-pushed the imgui-wrapper branch 3 times, most recently from 893d6a8 to ec69334 Compare January 17, 2025 18:33
@kassane kassane marked this pull request as ready for review January 17, 2025 18:40
@kassane
Copy link
Owner Author

kassane commented Jan 17, 2025

copying comments manually is so tedious! 😭

#51 fix 'size_t' matches conflicting symbols (see hidden comments), explained in #50

---edit

Sometimes get build error, if imgui (wasm32) buildstep run before emsdk_setup (requires assert.h)!

cc: @floooh

* move module cimgui to imgui
@kassane kassane merged commit d0bea8f into main Jan 19, 2025
4 checks passed
@kassane kassane deleted the imgui-wrapper branch January 19, 2025 13:17
@kassane
Copy link
Owner Author

kassane commented Jan 19, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant