without SDL_SetEventFilter
improved version