[SDL] Double buffering waitretrace and flickering

Daniel Tabuenca dtabuenc at cs.ucr.edu
Wed Aug 18 00:14:48 PDT 1999

Ok I am not sure what I am doing wrong. I am setting up a 640x480 fullscreen
mode in X with double buffering. Basically I am setting up another surface
64x64 and blitting it to the screen. I am using double buffering so my basic
loop goes something like.

-fill screen rectangle with black 
	(I know this is a slow way of earasing but
	 I am just using it to test this.)

-blit surface to screen
-flip buffers

 I am getting lots of flicker for some reason in fullscreen mode. After
checking the return of setting video mode I see that the double buffering and
hw flags are set (I am running under root using DGA). Is there any reason why
this would flicker? It flickers whether I am moving the sprite arround or if it
is just sitting there. I am not framerate limmiting at all so its going really
fast... Is this a problem?? The only other thing I can think of is that my
rectangle filling is not really doing it to the back buffer but to screen? How
do you make sure that you are writing to the back buffer? Anyway I don't see
how it could flicker.. If I draw to a back buffer it shouldn't matter how slow
fill rectangle and blitting is.  The only thing I can think of is that
SDL_flip isn't doing a wait for vertical retrace?? Any ideas anyone??

More information about the SDL mailing list