now using WHEEL_DELTA for mouse wheel processing, instead of a magic
authorDiederick Niehorster <dcnieho@gmail.com>
Wed, 21 Nov 2012 05:15:31 +0000 (05:15 +0000)
committerDiederick Niehorster <dcnieho@gmail.com>
Wed, 21 Nov 2012 05:15:31 +0000 (05:15 +0000)
number

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1463 7f0cb862-5218-0410-a997-914c9d46530a

src/mswin/fg_main_mswin.c

index 22a1d44..59b2530 100644 (file)
@@ -661,10 +661,7 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
         short ticks = ( short )HIWORD( wParam );
                fgState.MouseWheelTicks += ticks;
 
-        /*
-         * XXX Should use WHEEL_DELTA instead of 120
-         */
-               if ( abs ( fgState.MouseWheelTicks ) >= 120 )
+        if ( abs ( fgState.MouseWheelTicks ) >= WHEEL_DELTA )
                {
                        int direction = ( fgState.MouseWheelTicks > 0 ) ? 1 : -1;
 
@@ -675,10 +672,7 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
             fgSetWindow( window );
             fgState.Modifiers = fgPlatformGetModifiers( );
 
-            /*
-             * XXX Should use WHEEL_DELTA instead of 120
-             */
-            while( abs ( fgState.MouseWheelTicks ) >= 120 )
+            while( abs ( fgState.MouseWheelTicks ) >= WHEEL_DELTA )
                        {
                 if( FETCH_WCB( *window, MouseWheel ) )
                     INVOKE_WCB( *window, MouseWheel,
@@ -710,10 +704,7 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
                     );
                                }
 
-                /*
-                 * XXX Should use WHEEL_DELTA instead of 120
-                 */
-                               fgState.MouseWheelTicks -= 120 * direction;
+                               fgState.MouseWheelTicks -= WHEEL_DELTA * direction;
                        }
 
             fgState.Modifiers = INVALID_MODIFIERS;