-
Notifications
You must be signed in to change notification settings - Fork 220
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
Support system imgui libs #233
base: master
Are you sure you want to change the base?
Support system imgui libs #233
Conversation
* CMakeModules/FindImGui.cmake: Add CMake module. * src/CMakeLists.txt: Use it. * src/openboardview/CMakeLists.txt: Adjust accordingly.
What does the ImGui system package look like? |
@piernov Hi! It looks like this: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/toolkits.scm#n32. It currently does not use any build system (as it doesn't ship any). Here's what the package currently contains:
So yes, it includes the headers (and is built with support for) a few select backends. I first upgraded OpenBoardView from 8.95.1 to 8.95.2 without unbundling ImGui, so I could test both version, so it was easy to validate that 8.95.2 with its bundled copy of ImGui vs 8.95.2 using the system ImGui behaved the same. I must say that 8.95.2 seems to have some graphical glitch on my setup; Going back to 8.95.1, I no longer have these graphical artifacts. One thing that gets printed on the console with the system ImGui which I don't see with the bundled version are "Unknown key name" errors, like so:
Would you know what could be causing them? |
Ok, since the ImGui integration seems distribution-specific and there is not consensus on how to use it as a system package, it doesn't make a lot of sense to add support for a system-wide ImGui in OpenBoardView for now, so I am not going to merge this change yet. It seems to me that at least each backend should be built as a separate shared library (with its own set of dependencies). The utf8.h change is probably fine though, could you split the PR in two to merge that commit separately? About the graphical glitches, please open an issue describing your software&hardware configuration. The errors you are seeing in the terminal are normal after updating to 8.95.2, this is due to a change in keyboard handling for ImGui 1.87, you will have reset the keyboard configuration, see the release notes: https://github.com/OpenBoardView/OpenBoardView/releases/tag/8.95.2 . |
Hi,
The Arch Linux package uses some Microsoft-provided CMakeLists.txt file but the end result is the same:
Which is the same in the case of the
We can see their file list here. That is odd; they provide a static library (.a) and source code for the backends. It seems to me a better option would be to distribute a shared library which includes the support for the common GNU/Linux backends (OpenGL/Vulkan). Users can then use whatever they need and simply need linking against imgui. The transitive dependencies to support these backends doesn't change drastically anyway (it's mostly mesa).
Interesting. That's the very GPU I was testing with (nvidia 8800GTS); thanks for the research & workaround! Now the graphical glitches are gone, but the GUI is still difficult to use, due to seemingly not registering most of the clicks (opening a menu is rather difficult).
I confirm the keyword related errors went away after issuing |
Forgot to mention that I merged build system: Allow using utf8.h from the system in 1753efa. As for ImGui, I still think it doesn't make much sense to merge a change that would only work on one specific distribution and could cause issues on others, since the rendering backends are not included as a library (not included at all in ArchLinux, and source code only on Debian). Include path are not consistent either. In my opinion a better way to distribute ImGui in binary form and have applications be able to use it easily would be to provide a shared library for each supported rendering backend, and have a CMake file (pkg-config would also work) for each to include support if available. The 3 different ways the distributions identified here (Debian/ArchLinux/Guix) do it do not make it easy to have a common build process in OpenBoardView to use the system library. |
While more fine grained controls could be nice, I think a If users come and request such finer grained (and more complex) controls, we can improve on it, in my opinion. That Arch doesn't currently ship any support for backends could be easily changed, given you seem to be an Arch contributor? :-) |
For what it's worth, this still works with 9.95.0. |
This allows using the system provided utf8.h and imgui libraries. Tested using the GNU Guix package definition of OpenBoardView.