From 3eec065016664956e759ef8fc58d119945ed1506 Mon Sep 17 00:00:00 2001 From: rkrolib Date: Thu, 30 Oct 2003 03:51:33 +0000 Subject: [PATCH] Forgot to set {direction} explicitly to +/- 1 for freeglut mouse-wheel API on MS-WINDOWS. Oops. Now it should always report +/- 1 on MS-WINDOWS, per the spec. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@269 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/freeglut_main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/freeglut/freeglut/src/freeglut_main.c b/freeglut/freeglut/src/freeglut_main.c index e1138f3..74641a0 100644 --- a/freeglut/freeglut/src/freeglut_main.c +++ b/freeglut/freeglut/src/freeglut_main.c @@ -1459,9 +1459,15 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara { int wheel_number = LOWORD ( lParam ) ; /* THIS IS SPECULATIVE -- John Fay, 10/2/03 */ - int direction = HIWORD ( lParam ) / 120 ; + int ticks = HIWORD ( lParam ) / 120 ; /* Should be WHEEL_DELTA instead of 120 */ - int ticks = abs( direction ); + int direction = 1; + + if( ticks < 0 ) + { + direction = -1; + ticks = -ticks; + } /* * The mouse cursor has moved. Remember the new mouse cursor's position