How to syncronize SDL_UpdateRect(s) with vsync

Hello,

I have problem, when running my SDL application in fullscreen

mode, without double-buffer, when i’m updating the screen (not the whole
screen, but few rectangles), it flickers. So is it possible to synchronize
SDL_UpdateRect(s) with vertical retrace?

Kovacs

Hello,

I have problem, when running my SDL application in fullscreen
mode, without double-buffer, when i’m updating the screen (not the whole
screen, but few rectangles), it flickers. So is it possible to synchronize
SDL_UpdateRect(s) with vertical retrace?

No, although the best way to reduce flicker is to group your updates
so that they are all updated at once.

rect1 = eraseoldarea
rect2 = drawnewarea
updaterects(rect1, rect2)

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Well, i’m already using such techinque, i even update all rects at once,
but flicker remains, maybe almost invisible, but sometimes it becomes
visible.

So the only way to disable flicker is to run in double-buffered mode?

(btw. i’m running my application under Win98 with DX7)

KovacsOn Wed, 9 Feb 2000, Sam Lantinga wrote:

Hello,

I have problem, when running my SDL application in fullscreen

mode, without double-buffer, when i’m updating the screen (not the whole
screen, but few rectangles), it flickers. So is it possible to synchronize
SDL_UpdateRect(s) with vertical retrace?

No, although the best way to reduce flicker is to group your updates
so that they are all updated at once.

rect1 = eraseoldarea
rect2 = drawnewarea
updaterects(rect1, rect2)

-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software

“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Well, i’m already using such techinque, i even update all rects at once,
but flicker remains, maybe almost invisible, but sometimes it becomes
visible.

So the only way to disable flicker is to run in double-buffered mode?

Yes.
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec