now using WHEEL_DELTA for mouse wheel processing, instead of a magic

number


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1463 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
dcnieho 2012-11-21 05:15:31 +00:00
parent 2359c3cc11
commit 74b361d347

View 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;