A function pointer used for callbacks that watch the event queue.
Defined in SDL_events.h
userdata | what was passed as userdata to SDL_SetEventFilter() or SDL_AddEventWatch, etc |
event | the event that triggered the callback |
Returns 1 to permit event to be added to the queue, and 0 to disallow it. When used with SDL_AddEventWatch, the return value is ignored.
int MyEventFunction(void *userdata, SDL_Event *event) {
// Do things with userdata and event
return 0; // Value will be ignored
}
// ...
SDL_AddEventWatch(MyEventFunction, NULL);