src/SDL_compat.c
branchSDL-1.3
changeset 1722 5daa04d862f1
parent 1720 a1ebb17f9c52
child 1724 6c63fc2bd986
     1.1 --- a/src/SDL_compat.c	Fri Jun 30 05:50:35 2006 +0000
     1.2 +++ b/src/SDL_compat.c	Fri Jun 30 08:18:44 2006 +0000
     1.3 @@ -153,10 +153,11 @@
     1.4      return modes;
     1.5  }
     1.6  
     1.7 -static int (*orig_eventfilter) (SDL_Event * event);
     1.8 +static SDL_EventFilter orig_eventfilter;
     1.9 +static void *orig_eventfilterparam;
    1.10  
    1.11  static int
    1.12 -SDL_CompatEventFilter(SDL_Event * event)
    1.13 +SDL_CompatEventFilter(void *userdata, SDL_Event * event)
    1.14  {
    1.15      SDL_Event fake;
    1.16  
    1.17 @@ -227,7 +228,7 @@
    1.18          }
    1.19      }
    1.20      if (orig_eventfilter) {
    1.21 -        return orig_eventfilter(event);
    1.22 +        return orig_eventfilter(orig_eventfilterparam, event);
    1.23      } else {
    1.24          return 1;
    1.25      }
    1.26 @@ -251,7 +252,8 @@
    1.27  SDL_Surface *
    1.28  SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
    1.29  {
    1.30 -    int (*filter) (SDL_Event * event);
    1.31 +    SDL_EventFilter filter;
    1.32 +    void *filterparam;
    1.33      const SDL_DisplayMode *desktop_mode;
    1.34      SDL_DisplayMode mode;
    1.35      Uint32 window_flags;
    1.36 @@ -280,11 +282,12 @@
    1.37      SDL_DestroyWindow(SDL_VideoWindow);
    1.38  
    1.39      /* Set up the event filter */
    1.40 -    filter = SDL_GetEventFilter();
    1.41 +    filter = SDL_GetEventFilter(&filterparam);
    1.42      if (filter != SDL_CompatEventFilter) {
    1.43          orig_eventfilter = filter;
    1.44 +        orig_eventfilterparam = filterparam;
    1.45      }
    1.46 -    SDL_SetEventFilter(SDL_CompatEventFilter);
    1.47 +    SDL_SetEventFilter(SDL_CompatEventFilter, NULL);
    1.48  
    1.49      /* Create a new window */
    1.50      window_flags = SDL_WINDOW_SHOWN;