mcfletch / pyopengl

Repository for the PyOpenGL Project
Other
314 stars 97 forks source link

GetCurrentContext return value check too strict with wayland? #104

Open gerolfscherr opened 11 months ago

gerolfscherr commented 11 months ago

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

TTimo commented 4 months ago

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