[SDL] Re: Blitting / event handling with multiple threads
David Olofson
david at olofson.net
Tue Feb 1 17:05:47 PST 2005
On Wednesday 02 February 2005 00.57, Bruno Martínez Aguerre wrote:
[...]
> Interesting. Do you put SDL_PumpEvents periodically on your
> rendering thread's code?
That's one way of doing it; checking for events, timestamping any you
get using SDL_GetTicks() to potentially provide ms accurate input
timing.
As an extra bonus, this method avoids adding your own thread sync
code, since you stay in the rendering thread, and it works on
platforms without threading support.
However, AFAIK, on most platforms SDL gathers events using an event
thread that spins at 100 Hz, so 10 ms would be the best granularity
you can get, regardless of how and when you read events via SDL.
Bypassing SDL it would be the only option to get below 10 ms, but I
strongly doubt it would make a difference, unless you're implementing
a softsynth or something... (And then you have to use some other API
for MIDI anyway, automatically avoiding the event loop granularity
issue.)
//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