From: Diederick Niehorster Date: Wed, 21 Nov 2012 05:15:31 +0000 (+0000) Subject: now using WHEEL_DELTA for mouse wheel processing, instead of a magic X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=6432eb1d0f272a7d4ea7a9f2895699d7ab77d1a3;p=freeglut now using WHEEL_DELTA for mouse wheel processing, instead of a magic number git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1463 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/mswin/fg_main_mswin.c b/src/mswin/fg_main_mswin.c index 22a1d44..59b2530 100644 --- a/src/mswin/fg_main_mswin.c +++ b/src/mswin/fg_main_mswin.c @@ -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;