[SDL] SDL_PollEvent()

pixel fairy pixelfairy at gmail.com
Thu Nov 9 12:52:47 PST 2006


>
>
> Then we're talking about a more or less completely different problem.
> SDL_GL_SwapBuffer() is *supposed* to block as needed to keep the loop


woohoo!

in sync with the display refresh, but unfortunately, you cannot rely
> on this to work everywhere.


doh!


If you get 100% CPU load with the above loop, it's because something
> prevents SDL_GL_SwapBuffer() from synchronizing with the display
> refresh. It could be a broken driver, or an incorrectly configured
> driver. Some old drivers don't implement retrace sync at all, whereas
> hhe latter is commonly done deliberately by players of certain games,
> due to game logic bugs that favor players with insane frame rates.
> Drivers can usually be configured to override anything applications
> say, so there's no reliable way that an application can enforce
> retrace sync, even if the driver supports it.
>
> The really bad news is many drivers install with retrace sync disabled
> by default, and the vast majority of users have no clue as to what
> this is all about. :-(
>
> What you're doing above is the last resort, and it's about all you can
> do, short of just having users of broken systems pay with 100% CPU
> load.
>
> The problem with a delay in the render loop is that it often results
> in less smooth animation on properly configured systems (it just
> interferes with the retrace sync), so you should probably make it
> optional, or possibly switch it on automatically when needed.


i like this idea. whats a good way to detect if retrace sync is disabled?

//David Olofson - Programmer, Composer, Open Source Advocate
>
> .-------  http://olofson.net - Games, SDL examples  -------.
> |        http://zeespace.net - 2.5D rendering engine       |
> |       http://audiality.org - Music/audio engine          |
> |     http://eel.olofson.net - Real time scripting         |
> '--  http://www.reologica.se - Rheology instrumentation  --'
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20061109/42c0e7a1/attachment.html 


More information about the SDL mailing list