[SDL] 1.3 Event source addition

Torsten Giebl wizard at syntheticsw.com
Thu Jun 29 07:05:45 PDT 2006


Hello !


> I like the event loop of SDL and my only problem with 1.2 series is
> that the Event subsystem is completly hidden and close. There is no way to
> extends this part of the library that I know. It would really interesting
> to be able to register new event source that are triggered by SDL
> automatically.
>
>
> Supposing I am using a networking library like SDL_Net I need to
> construct my program the following
>
>
> begin event loop
>
> while there some SDL event do if event is a mouse event ... if event is a
> keyboard event ... ...
> end
>
> while there some Network event do ...
> end
>
> ...
> end
>
>
> It would be cool to be able to register our own source of event using
> an API call similar to
>
> struct SDLEventSource {
> void (*pushEvents)(void* userdata); void* userdata; };
>
>
> SDL_EventRegisterSource(SDL_EventSource* source);
>
>
> SDL_EventUnregisterSource(SDL_EventSource* source);
>
>
>
> With such call we can integrate in a consistent way user defined event.


Something like that would be really usefull,
for network coding but also other tasks
that needed to be synced in some way.


CU





More information about the SDL mailing list