A function definition to be used with SDL_AddEventWatch
int (*SDL_EventFilter)(void *userdata, SDL_Event *event);
userdata |
The data passed by the original call to SDL_AddEventWatch |
event |
The SDL_Event representing the event |
WARNING: Be very careful of what you do in this function, as it may run in a different thread!
This function's return value is ignored
Note: this callback is called for events posted by the user through SDL_PushEvent(), but not for disabled events, nor for events by a filter callback set with SDL_SetEventFilter(), nor for events posted by the user through SDL_PeepEvents().
int MyEventFunction(void *userdata, SDL_Event *event) {
// Do things with userdata and event
return 0; // Value will be ignored
}
// ...
SDL_AddEventWatch(MyEventFunction, NULL);
This function is available since SDL 2.0.0.