[SDL] Game event loop and input

David Olofson david at olofson.net
Fri Jan 31 07:22:01 PST 2003

On Friday 31 January 2003 02.42, Joby Bednar wrote:
> >I think this is more a general game programming question.
> >
> >Try www.gamedev.net or www.flipcode.com.
> >
> >Most importantly, try www.google.com.
> >
> >Check out the developer diaries on www.pyrogon.com.
> >
> >Check out the source to one/many of the many games listed on the
> > libsdl webpage.
> >
> >Owen Butler
> I was actaully hoping for any experience specifically with SDL
> events, since they are a little different than the Win32 message
> structure I'm used to coding in.

In what way? (Yes, I've done some Win32 programming as well...)

The only *important* difference is that SDL has only one place to send 
events, and no focus system. It couldn't have, in any useful way, so 
you have to implement that yourself in some way that works for you. 
If you want windows, controls and focus, just implement that.

The easy way is dispatching events in a main event handler and 
delivering them through function calls, but you could implement your 
own event queues as well, if you like that better. (Although that's 
only really useful if you get *tons* of events that you won't be able 
to handle without serious filtering, and you don't want to do the 
filtering in the dispatcher.)

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

.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`---------------------------> http://olofson.net/audiality -'
   --- http://olofson.net --- http://www.reologica.se ---

More information about the SDL mailing list