lordmauve / wasabi2d

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

OpenGL 4.3 not supported on Apple #14

Closed rbricheno closed 4 years ago

rbricheno commented 4 years ago

Trying to run any example results in output like the following:

$ python3 examples/lander/lander.py
2019-09-17 18:24:57.234 Python[8697:125101] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to (null)
Traceback (most recent call last):
  File "examples/lander/lander.py", line 28, in <module>
    title="Lunar Lander",
  File "/Users/Rob/wasabi2d-venv/lib/python3.7/site-packages/wasabi2d-0.1.0-py3.7.egg/wasabi2d/scene.py", line 57, in __init__
    depth=24
pygame.error: Failed creating OpenGL context at version requested
(wasabi2d-venv)
$

Sadly it seems that the most recent supported version of OpenGL on Apples is 4.1 https://support.apple.com/en-us/HT202823

Manually hacking the version in scene.py to 4.1 just results in a segfault (probably as expected). OpenGL 4.1 examples in moderngl (say) work fine.

lordmauve commented 4 years ago

We got a workaround for this - avoid indirect rendering. This will be a little slower; we might have to change some of the vertex buffer stuff to adapt to this.

dmoisset commented 4 years ago

We got a workaround for this - avoid indirect rendering.

Is this workaround somewhere, or this is something that has to be done? I still have the same problem testing on OS X, even with master.

lordmauve commented 4 years ago

Gah. We had it working on OS X but perhaps some of the set up didn't get committed?

Can you try as of d919443c4ddab0a0997621c732f80635823e5e2b? If that doesn't work and you have the ability on OS X, please can you look at those 2 changes and explore values for requested context version and version_code that make it work?

dmoisset commented 4 years ago

Yes, it is working now :)