Add support for ImGui v1.92.0#341
Conversation
With version v1.92.0, ImGui introduced the RenderHasTexture backend flag to enable backend to render fonts as raw textures. The current ImGui-SFML backend implementation does not support this feature and minimal examples don't run because of failing assertions. This commit provide support for the new RenderHasTexture backend flag while supporting previous version using the IMGUI_VERSION_NUM macro
|
I don't think I like the idea of supporting two API for imgui-sfml itself at the same time. |
|
Maybe there's a way to emulate the new API for imgui < 1.92 |
|
Here's what I came up with. It works with ImGui < 1.92 but it has the same API and behaviour as ImGui >= 1.92 |
|
Hello @lapinozz, thank you for having a look to the PR. Yea, also to me is not very elegant the usage of the macro to check ImGui version, it makes it a little cumbersome in the sake of backward compatibility. Actually I don't have an opinion on dropping entirely support for ImGui < 1.92. |
|
Just to inform that at least on MacOS it is currently not working great. However those version in vcpkg work flawlessly
|
|
I think the version on vcpkg has some code changed applied, hopefully once everything is figured out those should be removed The fonts are not working even with ImGui 1.91? |
Yes I confirm that the vcpkg port does not work because of a patch that insert a bug in UpdateFontTexture. For making this work, I added a custom overlay that does not contain the patch and points to my fork. I added some details here. I tested on macOS arm. |
With version v1.92.0, ImGui introduced the RenderHasTexture backend flag to enable backend to render fonts as raw textures. The current ImGui-SFML backend implementation does not support this feature and minimal examples don't run because of failing assertions.
This commit provide support for the new RenderHasTexture backend flag while supporting previous version using the IMGUI_VERSION_NUM macro.
Inspired by #336 and #330