[SDL] SDL_Flip doesn't wait vsync under X11

Antony Lesuisse al-lists at udev.org
Sat Mar 3 22:04:07 PST 2007


http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fFlip says

If your display mode is using the flags pygame.HWSURFACE and pygame.DOUBLEBUF, 
this will wait for a vertical retrace and swap the surfaces. If you are using 
a different type of display mode, it will simply update the entire contents of 
the surface.

It doesn't work with SDL under X11, wich mean that every SDL applications runs 
with tearing artefacts under X11. IMHO it is a CRITIAL bug. I know it's due to 
X11, but a solution must be found NOW ! It's amazing to imagine that simple 
graphical applications that could be done on a C64 cannot be done under 
Linux/X11 in 2007 :).

http://bugzilla.libsdl.org/show_bug.cgi?id=406 Opened

With pygame installed, you can easily test it (if you like to take risks) by 
typing on a terminal:

   python -c "`curl http://lesuisse.net/vsynctest.py `"

or run the following python code
-----------------------------------
#!/usr/bin/python
import math,sys,time,pygame
pygame.init()
screen = 
pygame.display.set_mode((640,480),pygame.FULLSCREEN|pygame.DOUBLEBUF|pygame.HWSURFACE)
c=0
while 1:
     c=((c+1)%2)*255
     for event in pygame.event.get():
         if event.type in [2,5,6,12]:
             sys.exit()
     screen.fill((c,c,c))
     pygame.display.flip()
------------------------------------



More information about the SDL mailing list