Open asdfjkluiop opened 2 years ago
Hey @asdfjkluiop,
That is indeed true, the GL
class assumes GLX on Linux. However, LWJGL has EGL bindings and GLFW supports EGL (see GLFW_EGL_CONTEXT_API
). On Wayland, I believe the correct approach would be:
Configuration.OPENGL_EXPLICIT_INIT.set(true);
GL.create(EGL.getFunctionProvider());
and then you would proceed with the usual GLFW setup.
Version
3.3.0 (nightly)
Platform
Linux x64
JDK
Eclipse OpenJ9 VM 17.0.2.0
Module
OpenGL
Bug description
GL.create()
assumes GLX on Linux usinglibGL.so
andglXGetProcAddress()
. The problem with this islibGL.so
isn't always available on wayland platforms causing LWJGL initialization to fail. I ran into this bug on a fresh debian install where the only thing installed was the sway wayland compositor.libEGL
is present but notlibGL
since wayland uses EGL for context management. My game engine works around this by settingConfiguration.OPENGL_EXPLICIT_INIT.set(true)
and then usingGL.create(GLFW::glfwGetProcAddress)
since GLFW uses the API for context creation to implement that function however LWJGL's automatic extension loading should avoid making assumptions about what windowing system is being used as it can break in some cases. To be honest I don't know what a good fix for this is besides just leaving it to the engine/game but I figured I'd bring it up in case anyone had a solution that could be put into LWJGL.Stacktrace or crash log output
No response