Setup portable code multiplatform ImPlatform.h #3921
Replies: 2 comments 1 reply
-
We have such helper internally, but releasing it would create much more support request for us so it's presently not worth it. |
Beta Was this translation helpful? Give feedback.
-
Here my attempt for that (For now only support {Win32}x{Dx9, Dx10, Dx11, OpenGL3}: The main is simplified as: TODO: Add more platform {Linux, Emscriptem, Mac} more Gfx Api {Vulkan, Metal, WGPU}. |
Beta Was this translation helpful? Give feedback.
-
Open question:
How could we setup a portable example with minimum dependencies?
Currently, when we want to share code using ImGui we have to make choose of one backend or reimplement (copy paste examples) for each target.
Does that make sense to have a way to move platform-independent code out of our main?
The re-routing will be done from ImPlatform.h, which mostly include backend under #ifdefs.
Which can fit perfectly on a build system (Sharpmake, CMake, ...), we can dispatch various builds with specification of global defines "IS_WINDOWS", "IS_APPLE", ...
ImPlatform could be splitted:
A draft of a target code:
Beta Was this translation helpful? Give feedback.
All reactions