-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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_IMPL_OPENGL_LOADER_CUSTOM isn't included anymore #4810
Comments
We're only keeping
We should do this, you can attempt patches to https://github.com/dearimgui/imgl3w
However it seems that things already work for you and you are only fixing a theoretical problem. |
Ah, it should work for that, although it would be nice if it also worked when the backend was compiled on its own.
I'm working on a patch for gl3w. One issue is that the GetProcAddress implementation could end up using EGL while other parts of your application, (or even other loaders) use GLX (or vice-versa). I don't know if this would actually be an issue in practice though, it seems like it still works when using the GLVND implementations of GLX/EGL,
Yes, it works on my machine since GLX is still installed and |
if I were you i would wait to actually run into a problem before blindly solving this. |
I dug into this a little bit out of curiosity since I've been messing with Wayland lately, and while I'm not a huge fan of mixing GLX and EGL either I don't think it's really an issue of immediate concern. (Although I do worry it's something that could go bang after a driver update though since it's not exactly typical.) When it comes to supporting EGL in the first place, one practical concern I do have though is that our current loader implementation is implicitly causing anyone using the OpenGL backend to depend on X since libGL depends on (is?) GLX which depends on X. (This is the whole reason Wayland uses EGL instead of libGL in the first place -- "Why does Wayland use EGL?") In 2021 I don't think it's actually practical to have a useful Linux system running Wayland without XWayland yet. Maybe you can with Weston?
Could we use I don't think that'd be appropriate for gl3w upstream, but it'd make sense for a sibling GL loader like Dear ImGui's. |
Yes, I considered this. It's a bit of a hack, but it seems to work. It might make sense to have it upstream too, since you still want the loader to match what the windowing library (SDL/glfw/glut/etc) is using. I've made a PR here: skaslev/gl3w#74 |
Thanks! |
Environment
ImGui Version: 1.85 (master)
Platform Backend: imgui_impl_sdl.cpp
Render Backend: imgui_impl_opengl3.cpp
Operating System: Linux
Desktop: Plasma Wayland
Issue
ImGui checks for an
IMGUI_IMPL_OPENGL_LOADER_CUSTOM
define, and it used to import it if it was defined, but after the ImGL3W loader changes it no longer does that, so it simply fails to compile because it doesn't include any loader, unless you build it as an amalgam that includes a loader.The reason I'm using a custom loader is because I want my application to have native Wayland support. The included gl3w-based loader uses GLX, which is an X11-specific API. This seems to work because GLX is still available on my system and
glxGetProcAddress
happens to still work, but only EGL is officially supported under Wayland. I can use my own loader (GLAD withSDL_GL_GetProcAddress
which supports EGL), but I can't get ImGui to use that loader because of this issue.Proposed Solution
I solved the issue with the following patch:
My problem would also be solved by adding EGL support to the default loader so I don't need a custom loader (which should be done anyways, but that's really a
gl3w
issue). But I'd still likeIMGUI_IMPL_OPENGL_LOADER_CUSTOM
to work without using an amalgam.The text was updated successfully, but these errors were encountered: