-
Notifications
You must be signed in to change notification settings - Fork 5
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
add IMGUI support #23
Conversation
Need cimgui binding for run example. Old module amalgamation cimgui + sokol_imgui: now, only sokol_imgui: Lines 103 to 115 in 1110006
|
Some questions (for zig-dev)What would you add
|
Please, @floooh. Test it! Note: For wasm32 build change... Line 245 in 8d589cb
Why block? CI error. Why And for old ldc2 versions (1.36...1.38 [latest]) change... Lines 512 to 515 in 8d589cb
|
* sokol_fetch support & new example * fix emsdk setup and link, by @floooh (ref.: floooh/sokol-zig#70)
Note that there was an bug in the translateC step in the cimgui sample which caused this above error about missing assert.h in imgui.h when trying to build for wasm32-emscripten. I fixed this by always running the translateC step with the host target (instead of the build target): ...otherwise I would somehow need to inject the Emscripten include path into the translateC step. Using the host triplet is the better solution though, since there no platform-specific stuff happening in the translateC step. |
According to this solution, perhaps it would have been possible to use importC to bypass the error, just like translate-c. Lines 79 to 82 in 20fe32c
Lines 184 to 194 in 20fe32c
Another question that puzzles me. Would it be useful to use the |
Ah btw, I fixed this a bit differently, by letting the cimgui library depend on the sokol C library (up in the top level project): Since the sokol C library depends on the Emscripten SDK setup this also guarantees that the SDK is setup when cimgui is compiled (e.g. the idea is that all C libraries need to depend on the sokol C library... but maybe this could indeed be moved up into sokol-zig since we're iterating over the C libraries anyway in the linker step - also the injection of the Emscripten include path... hmm...)
Not a fan tbh, it would probably make more sense to move the emsdk stuff into a separate project (and Zig package) which could then be used both by sokol-zig and sokol-d. |
Wrote a ticket for that idea (to handle the C library stuff in sokol-zig build.zig): floooh/sokol-zig#71 |
Make sense. Like, |
fix #10
old branch, need long rebase... I'll delete (for testing only)
https://github.com/kassane/sokol-d/tree/imgui-support
inspired by: