Description
I was following up on a help post on the Discord server, and I have replicated an issue where pygame.Window.flip() no longer seems to work on Mac.
Current behavior:
When you create a window and get the associated surface, if you fill the surface, or draw to it, or load an image and blit to it, then call flip(), the screen is not updated and remains blank/black.
Expected behavior:
The window surface is updated and images, shapes, fill colors are presented correctly on the surface.
Steps to reproduce:
On a Mac:
- Create a pygame.WIndow object
- get the display surface by calling pygame.Window.get_surface()
- fill the surface, or draw to it, or blit an image to it
- call pygame.Window.flip()
- Observe the screen remaining blank/black
Test code
The test code is that which is listed in the docs, however I have tested with drawing shapes and blitting images to the surface and have the same results:
import pygame
win = pygame.Window()
surf = win.get_surface() # get the window surface
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
raise SystemExit
# draw something on the surface
surf.fill("red")
win.flip() # update the surface to the window
Please note I've repeated the testing on Windows and have no issues, works fine.
On Mac my testing showed the following:
2.4.0 to 2.5.0.dev2 - sample code works successfully
2.5.0.dev4 and beyond - sample code runs but the window / surface is not updated