[SDL] SDL_PollEvent()
David Olofson
david at olofson.net
Wed Nov 8 03:09:53 PST 2006
On Friday 03 November 2006 00:55, pixel fairy wrote:
[...]
> would making it a poll/select call be bad? or just too much work for
> the gain? i like to make light apps, that only hit the cpu when they
> need to by waiting on input until its time to swap buffers.
I think the problem is that many platforms have several different APIs
that don't mix when it comes to select() or similar.
What you can do is create separate threads that do the blocking I/O,
and have these threads communicate with the main thread through a
single IPC mechanism (like the SDL event system), allowing all
threads to block properly on their respective APIs.
//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 --'
More information about the SDL
mailing list