This is why I try to enable vsync in OpenGL , and if anyone’s seen my other
email earlier I had this annoying issue where the waiting for vsync somehow
manifested itself in the SDL event queue … currently I have my loops
arranged in a way such that this doesn’t happen, and I have to say that
vsync is 100% smooth.
However, from my experiences, if you are NOT enabling vsync, no matter what
timing method you use, it will completely fail at synching up with the
monitor and you might as well put a couple Sleep calls in since busy waiting
doesn’t make it any smoother, and may also contribute more lag as has been
mentioned.
Of course this is with OpenGL rendering and may or may not pertain to
regular SDL rendering.On Wed, Jul 2, 2008 at 8:40 PM, Pierre Phaneuf wrote:
On Wed, Jul 2, 2008 at 7:39 PM, Will Langford wrote:
Continuing – most modern systems will simply just task switch away
from your game process as needed. If your programming layer requires
something to process events and similar (see the evils of DoEvents in
VB), I can understand wanting to sleep() for a moment, then. But on
most platforms, this shouldn’t be necessary ? no ?But, I’d also venture a guess that while playing a game, you should
assume the player wants the game experience to be top notch at the
expense of their bit torrent download in the background… :).The problem is that if a game hogs the CPU, then the operating system
will just take it away forcibly to let the (hopefully!) well-behaved
BitTorrent download, possibly at an inopportune time.The idea is that if you’re getting a sufficiently high frame rate, you
sleep a little bit, and when you really need the CPU, you have it.
But spinning and drawing the screen at 150 fps (when most LCD displays
refresh at no more than 60 fps anyway!) can actually make it more
“jittery”, where the operating system wrests away the CPU in the
middle of rendering a frame, things like that.–
http://pphaneuf.livejournal.com/
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org