src/video/windows/SDL_windowsevents.c
changeset 9599 223fbcc6a327
parent 9597 345bc53b52b8
child 9619 b94b6d0bff0f
     1.1 --- a/src/video/windows/SDL_windowsevents.c	Wed May 13 22:39:27 2015 -0700
     1.2 +++ b/src/video/windows/SDL_windowsevents.c	Wed May 13 22:39:32 2015 -0700
     1.3 @@ -928,10 +928,12 @@
     1.4  
     1.5  /* A message hook called before TranslateMessage() */
     1.6  static SDL_WindowsMessageHook g_WindowsMessageHook = NULL;
     1.7 +static void *g_WindowsMessageHookData = NULL;
     1.8  
     1.9 -void SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback)
    1.10 +void SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata)
    1.11  {
    1.12      g_WindowsMessageHook = callback;
    1.13 +    g_WindowsMessageHookData = userdata;
    1.14  }
    1.15  
    1.16  void
    1.17 @@ -944,7 +946,7 @@
    1.18      if (g_WindowsEnableMessageLoop) {
    1.19          while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
    1.20              if (g_WindowsMessageHook) {
    1.21 -                g_WindowsMessageHook(msg.hwnd, msg.message, msg.wParam, msg.lParam);
    1.22 +                g_WindowsMessageHook(g_WindowsMessageHookData, msg.hwnd, msg.message, msg.wParam, msg.lParam);
    1.23              }
    1.24  
    1.25              /* Always translate the message in case it's a non-SDL window (e.g. with Qt integration) */