[SDL] Window resizing

Ben Campbell ben.campbell at cyberlife.co.uk
Thu Apr 27 02:04:34 PDT 2000


>Polling for the retrace is really out of the question on a multitasking
>system.

Not if the alternative is blasting frames to the frame buffer as fast as you
can. If you are spending 100% CPU already, polling won't make matters worse.

>The right thing is this: those modern boards usually support a "wait for
>vertical retrace" flag on their command, which will let the *board* do
>all the waiting.

Unless your game is of the type "blit an entire screenful each frame",
perhaps playing a movie. If you don't want to grab 100% CPU, you have to
wait for *something*. In that case a device that blocks on a read() or ioctl()
until the next refresh would be handy, even if imprecise.

Maybe it could be simulated by short sleeps (using RTC) and polls,
I haven't looked into this. But you would still need a way to find out whether
a vertical retrace has taken place.




More information about the SDL mailing list