mcfletch / pyopengl

Repository for the PyOpenGL Project
Other
329 stars 104 forks source link

GetCurrentContext return value check too strict with wayland? #104

Open gerolfscherr opened 1 year ago

gerolfscherr commented 1 year 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 7 months ago

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