I am trying to naively port some existing SDL 1.2 code to 1.3.
The existing code calls SDL_SetEventFilter to add a mouse event filter. In SDL1.3 there is a new argument void* userdata in SDL_EventFIlter and in the event method signature. Apparently SDL 1.2 only has one internal event queue which is used as the default, Where do I get the event queue to use in SDL 1.3? I tried Googling for an example and haven’t found one yet.
The code is as follows. Here is the event filter:
Code:
int event_filter(SDL_Event *e)
{
if (e->type == SDL_MOUSEMOTION) {
cursor->move(e->motion.x, e->motion.y);
cursor->redraw();
}
return 1;
}
It is set in an initialization routine with the call
Code:
SDL_SetEventFilter(event_filter);
At shutdown there is a call
Code:
SDL_SetEventFillter(0);
My two questions are
- What do I use for the void* userdata argument that SDL_SetEventFilter needs in 1.3?
- Does this event_filter method have to do anything with the void* userdata argument that it gets in 1.3?