src/video/windows/SDL_windowsevents.c
changeset 7912 10eff60470b3
parent 7911 a9135f92ddba
child 7941 7c249ca44069
equal deleted inserted replaced
7911:a9135f92ddba 7912:10eff60470b3
   489             static short s_AccumulatedMotion;
   489             static short s_AccumulatedMotion;
   490 
   490 
   491             s_AccumulatedMotion += GET_WHEEL_DELTA_WPARAM(wParam);
   491             s_AccumulatedMotion += GET_WHEEL_DELTA_WPARAM(wParam);
   492             if (s_AccumulatedMotion > 0) {
   492             if (s_AccumulatedMotion > 0) {
   493                 while (s_AccumulatedMotion >= WHEEL_DELTA) {
   493                 while (s_AccumulatedMotion >= WHEEL_DELTA) {
   494                     SDL_SendMouseWheel(data->window, 0, 1, 0, timestamp);
   494                     SDL_SendMouseWheel(data->window, 0, 1, 0);
   495                     s_AccumulatedMotion -= WHEEL_DELTA;
   495                     s_AccumulatedMotion -= WHEEL_DELTA;
   496                 }
   496                 }
   497             } else {
   497             } else {
   498                 while (s_AccumulatedMotion <= -WHEEL_DELTA) {
   498                 while (s_AccumulatedMotion <= -WHEEL_DELTA) {
   499                     SDL_SendMouseWheel(data->window, 0, -1, 0, timestamp);
   499                     SDL_SendMouseWheel(data->window, 0, -1, 0);
   500                     s_AccumulatedMotion += WHEEL_DELTA;
   500                     s_AccumulatedMotion += WHEEL_DELTA;
   501                 }
   501                 }
   502             }
   502             }
   503             break;
   503             break;
   504         }
   504         }