[SDL] Double buffering waitretrace and flickering

Karsten-Olaf Laux klaux at student.uni-kl.de
Wed Aug 18 01:31:00 PDT 1999


on Mit, 18 Aug 1999 dtabuenc at cs.ucr.edu wrote:
>Perhaps I am totally clueless (or just used to opengl) but I was under
>the impression that all writes were to the backbuffer. If not How do
>you write to the backbuffer? I am just writing to the surface returned
>by SDL_SetVideoMode. How do I reach or write to that back buffer? 
>On 18 Aug, Michael Lunnay wrote:
>> 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.

to my knowledge you only have access to the backbuffer. 
When using double buffering you should test the return value of
SDL_SetVideoMode in order to check if you have really a double buffer.
As far as I know SDL_Flip() waits to vsync, the one possible reason for the
flickering might be, that your back- and frontbuffer are not in sync, meaning,
they contain different content.

hope this help, somehow.

Karsten-O. Laux           
klaux at student.uni-kl.de

More information about the SDL mailing list