[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] video synch



jabberwocky wrote:
How can I synchronize video updating with game event? For example, in my game before starting a new level appear the string "Start Level ..." that
should disappear after n seconds, allowing the Level start. But the time
loading need to appear the screen with the string make the actual number
of seconds less than n, since I see the string only for a little time. Is there a way to correct this problem?
This doesn't sound so much like a video sync issue. Check to make sure you are calling pygame.display.flip() or pygame.display.update() after showing the text. It sounds like your levels load very fast, you may not need to show a loading screen?

Video sync is needed to fix "tearing artifacts". These are seen when you have large animated objects or changing screens. For a single screen change it rarely matters. What happens is the animated screen changes while the monitor is halfway through drawing the screen. When it changes you see half of the old frame and half of the new frame.

Unfortunately SDL provides no way to control video sync. It has many video drivers and they all do what they please in regards to refresh rate and video sync.