lordmauve / wasabi2d

Cutting-edge 2D game framework for Python
https://wasabi2d.readthedocs.io/
GNU Lesser General Public License v3.0
154 stars 24 forks source link

wasabi2d HEAD doesn't work on Python 3.11+ due to reliance on old moderngl #79

Open larryhastings opened 7 months ago

larryhastings commented 7 months ago

As per wasabi2d's requirements.txt, the current HEAD requires

    moderngl==5.6.*

This version is already more than a year out of date; moderngl 5.7 shipped in October of 2022, and the current release is 5.8.2.

Unfortunately, if you attempt to build moderngl 5.6.* for Python 3.11 you get a compilation error. Python 3.11 changed the Py_TYPE macro so it can no longer be used as an l-value (used for assignment), and this is something moderngl still did in 5.6. (The release notes for moderngl 5.7 say that it now supports 3.11.)

wasabi2d requires this old version of moderngl because it relies on a symbol named context, which moderngl no longer exports. I don't know what the old symbol did, but I suspect there's a modern equivalent. (moderngl now exports symbols called create_context and create_standalone_context, maybe one of those would create the needed context object?)

einarf commented 6 months ago

Assuming pygame make the GL context you just need to call moderngl.create_context() to get the Context instance (attached to the context pygame created. Nothing more complicated.