A function pointer used for callbacks that watch the event queue.
Defined in [SDL_events.h](https://github.com/libsdl-org/SDL/blob/SDL2/include/SDL_events.h), but apps should _only_ `#include "SDL.h"`!
typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
userdata |
what was passed as |
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);
userdata |
The data passed by the original call to SDL_AddEventWatch |
event |
The SDL_Event representing the event |
CategoryAPI, CategoryAPIDatatype, CategoryEvents