Incorrect Platform on Wayland
Brought to you by:
mcfletch
When using Wayland, pyOpenGL sould default to using the egl platform, but it continues to use glx. Can this be fixed via something like this:
if "wayland" in os.getenv("XDG_SESSION_TYPE", "").lower() and not os.environ.get("PYOPENGL_PLATFORM", ""):
os.environ["PYOPENGL_PLATFORM"] = "egl"
For a full discussion of the trouble that this caused, checkout:
https://sourceforge.net/p/pyopengl/mailman/pyopengl-users/thread/M5HjopY--3-2%40tutanota.com/
https://github.com/FlorianRhiem/pyGLFW/issues/49
I've pushed code to attempt to address this in the develop branch on github: https://github.com/mcfletch/pyopengl which should detect wayland. Note that it also uses EGL under xwayland, though I'm not sure that is the correct path. Note also that XDG_SESSION_TYPE will often be missing if wayland wasn't started from a desktop manager, so we'll also check for WAYLAND_DISPLAY.
Please test if this addresses your issue.
Hi @mcfletch, your change in the develop branch on github solved this issue for me (more details on https://github.com/mcfletch/pyopengl/issues/41). It's not urgent at all, but is there any reason the develop branch is not merged yet?