[SDL] Double buffering waitretrace and flickering
ra at box.net.au
Wed Aug 18 00:58:22 PDT 1999
are you drawing to the back buffer or to the screen. If you are drawing to
the screen you will still get the screen tearing as you are not wating for
the vsync of the monitor. you need to do all your work to the back buffer
and once that is complete you then flip the surface to display the contents.
hope this helps.
From: Daniel Tabuenca <dtabuenc at cs.ucr.edu>
To: sdl at surfnetcity.com.au <sdl at surfnetcity.com.au>
Date: Wednesday, 18 August 1999 17:10
Subject: [SDL] Double buffering waitretrace and flickering
>Ok I am not sure what I am doing wrong. I am setting up a 640x480
>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
>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
> 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
>hw flags are set (I am running under root using DGA). Is there any reason
>this would flicker? It flickers whether I am moving the sprite arround or
>is just sitting there. I am not framerate limmiting at all so its going
>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?
>do you make sure that you are writing to the back buffer? Anyway I don't
>how it could flicker.. If I draw to a back buffer it shouldn't matter how
>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