You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The examples/overlay.py code is not working. The main issue appears to be that SDL_Overlay support has been removed in SDL2.0.
To Do
python 3 execution has a str/bytes issue,
the opened file not being closed.
Unit tests for overlay module.
overlay module working on SDL2.
The following code runs the overlay example code. Different versions of python and pygame were tested with the results shown below. The overlay example code works using python 2.7.10 and pygame 1.9.4 and fails with the other combinations.
# Filename: overlay_examples_issue.pyimportosimportpygameimportpygame.examplesimportpygame.examples.overlayasoverlay# Run the overlay example code.DATA_DIR=os.path.join(os.path.split(pygame.examples.__file__)[0], 'data')
overlay.main(os.path.join(DATA_DIR, 'yuv_1.pgm'))
Output with python 3.7.2 and pygame 2.0.0.dev3.
pygame 2.0.0.dev3 (SDL 2.0.9, python 3.7.2)
Hello from the pygame community. https://www.pygame.org/contribute.html
Unknown format( len 2 ). Exiting...
Output with python 2.7.10 and pygame 2.0.0.dev3.
pygame 2.0.0.dev3 (SDL 2.0.9, python 2.7.10)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "overlay_examples_issue.py", line 10, in <module>
overlay.main(os.path.join(DATA_DIR, 'yuv_1.pgm'))
File "C:\Program Files\Python27\lib\site-packages\pygame-2.0.0.dev3-py2.7-win-amd64.egg\pygame\examples\overlay.py", line 52, in main
vPlayer(fname)
File "C:\Program Files\Python27\lib\site-packages\pygame-2.0.0.dev3-py2.7-win-amd64.egg\pygame\examples\overlay.py", line 36, in vPlayer
ovl= pygame.Overlay(pygame.YV12_OVERLAY, (w,h))
AttributeError: 'module' object has no attribute 'YV12_OVERLAY'
Output with python 3.7.2 and pygame 1.9.4.
pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html
Unknown format( len 2 ). Exiting...
Output with python 2.7.10 and pygame 1.9.4. The overlay code works in this instance.
pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html
System details:
os: windows 10 (64bit)
python: 3.7.2 (64bit) and 2.7.10 (64bit)
pygame: 1.9.4 and 2.0.0.dev3 (SDL: 2.0.9) at c8c9e82
I think we've given up on the overlay module. It's an SDL1 thing that's not present in SDL2. I just removed the last code remnants of it in a recent PR. If the example is still around it should be removed as well.
The
examples/overlay.py
code is not working. The main issue appears to be thatSDL_Overlay
support has been removed in SDL2.0.To Do
The following code runs the overlay example code. Different versions of python and pygame were tested with the results shown below. The overlay example code works using python 2.7.10 and pygame 1.9.4 and fails with the other combinations.
Output with python 3.7.2 and pygame 2.0.0.dev3.
Output with python 2.7.10 and pygame 2.0.0.dev3.
Output with python 3.7.2 and pygame 1.9.4.
Output with python 2.7.10 and pygame 1.9.4. The overlay code works in this instance.
System details:
Related Docs: https://www.pygame.org/docs/ref/overlay.html
The text was updated successfully, but these errors were encountered: