jidiai / Competition_Olympics-Running

MIT License
16 stars 7 forks source link

Rendering bugs #2

Closed R-Ceph closed 2 years ago

R-Ceph commented 3 years ago

When using render mode under Linux, the game window will appear and disappear repeatedly. Testing on Ubuntu 18.04

YanSong97 commented 2 years ago

now should be fixed, many thanks ! 👍

R-Ceph commented 2 years ago

Thanks for your reply, but I found that the new code has some problems when using multi-process. I think possible solutions should be:

  1. "Pygame.display.set_mode(self.WIN_SIZE)" should not appear in the initialization of the Viewer class, otherwise, a multi-process error will occur:

XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0" after 235 requests (235 known processed) with 0 events remaining

  1. "pygame.display.set_mode(self.WIN_SIZE)" should now be used when calling render(), otherwise the game window will appear and disappear repeatedly.