pyopengl icon indicating copy to clipboard operation
pyopengl copied to clipboard

GetCurrentContext return value check too strict with wayland?

Open gerolfscherr opened this issue 2 years ago • 1 comments

my setup: pygame 2.5.2, PyOpenGL 3.1.7 Ubuntu 22.04.3 LTS (XDG_SESSION_TYPE="wayland") running the pygame example 'glcube.py' yields: "OpenGL.error.Error: Attempt to retrieve context when no valid context"

On my system the call ''platform.GetCurrentContext()" returns 0, which looks like a reasonable value, but is considered invalid in this line:

https://github.com/mcfletch/pyopengl/blob/29b79e8966ba2930a5c44829b02dffc1ca600752/OpenGL/contextdata.py#L38

If i comment out the check, the example works. So maybe the check is too strict? (should check for None instead of 0?)

see also https://github.com/pygame/pygame/issues/3110

gerolfscherr avatar Oct 04 '23 11:10 gerolfscherr

Looks to be a problem for us also (in WSL), +1

TTimo avatar Apr 25 '24 20:04 TTimo