[SDL] Re: SDL and KDevelop (Jfs Dlt)

Danni Coy rgcoy at midcoast.com.au
Thu Nov 20 17:07:01 PST 2003

On Friday 31 October 2003 19.45, brian wrote:
> Well, it seems to me for applications like word or whatever, this
> scheme is fine.  Because basically things only change when the user
> does something.  But games need to run as fast as possible... and
> things change even if the user isn't doing input.  Do you think
> someone playing quake would want to only see things update whenever
> they did a command?

OTOH, who cares if Quake renders more than one frame per CRT refresh? 
;-) (In fact, that's worse than one per refresh, as it causes 

What I'm saying is that *all* normal applications, including all kinds 
of games, respond to events in one form or another. The retrace sync 
is just another event that you should preferably use as you time base 
if you want smooth animation.

Note that the case where you can't get retrace sync is just a special 
case, which forces you to rely on some kind of hack. The most common 
solution is to just ignore the problem and have the engine run as 
fast as it can, as if there always was a pending retrace sync 

> Without also multithreading in your scheme, it
> seems like your renderloop would stall while waiting for user
> input.

I guess that's intended, but there are better ways of implementing 
"timer controlled animation", if you really don't want to rely on 
retrace sync, or render at full speed if retrace sync is not 

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
|  Free/Open Source audio engine for games and multimedia.  |
| MIDI, modular synthesis, real time effects, scripting,... |
`-----------------------------------> http://audiality.org -'
   --- http://olofson.net --- http://www.reologica.se ---

More information about the SDL mailing list