src/events/SDL_events.c
changeset 7201 c6b3d3c32507
parent 7191 75360622e65f
child 7304 9598cbf46957
equal deleted inserted replaced
7200:54c9f310f7c0 7201:c6b3d3c32507
   386 }
   386 }
   387 
   387 
   388 void
   388 void
   389 SDL_SetEventFilter(SDL_EventFilter filter, void *userdata)
   389 SDL_SetEventFilter(SDL_EventFilter filter, void *userdata)
   390 {
   390 {
   391     SDL_Event bitbucket;
       
   392 
       
   393     /* Set filter and discard pending events */
   391     /* Set filter and discard pending events */
       
   392     SDL_EventOK = NULL;
       
   393     SDL_FlushEvents(SDL_FIRSTEVENT, SDL_LASTEVENT);
       
   394     SDL_EventOKParam = userdata;
   394     SDL_EventOK = filter;
   395     SDL_EventOK = filter;
   395     SDL_EventOKParam = userdata;
       
   396     while (SDL_PollEvent(&bitbucket) > 0);
       
   397 }
   396 }
   398 
   397 
   399 SDL_bool
   398 SDL_bool
   400 SDL_GetEventFilter(SDL_EventFilter * filter, void **userdata)
   399 SDL_GetEventFilter(SDL_EventFilter * filter, void **userdata)
   401 {
   400 {