[SDL] Whdn do events get queued?
Ryan C. Gordon
icculus at icculus.org
Mon Jun 11 20:04:43 PDT 2007
> How many events can SDL queue, though, if you fail to pop them off the queue?
128.
...and while there's a mechanism in SDL to decide if the queue
overflowed, nothing checks the return values, so you _will_ silently
lose events if it overflows.
I'm a little horrified to learn this, having just checked, but it's sort
of like checking malloc() for a return value...you _can_ handle NULL,
but in 99% of the cases, your only option is to quit or crash anyhow.
Changing that to a dynamically growing linked list would solve the
issue, but honestly, I'm not sure it's worth it. Realistically, it's
never been a problem for me, though. Just handle events once per frame,
or look for this in SDL/src/events/SDL_events.c and make it bigger:
#define MAXEVENTS 128
--ryan.
More information about the SDL
mailing list