wasabi2d icon indicating copy to clipboard operation
wasabi2d copied to clipboard

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

Open larryhastings opened this issue 1 year ago • 1 comments

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?)

larryhastings avatar Dec 09 '23 19:12 larryhastings

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.

einarf avatar Jan 16 '24 18:01 einarf