+ fgSetWindow( window );
+ fgState.Modifiers = fghGetWin32Modifiers( );
+
+ /*
+ * XXX Should use WHEEL_DELTA instead of 120
+ */
+ while( abs ( fgState.MouseWheelTicks ) > 120 )
+ {
+ if( FETCH_WCB( *window, MouseWheel ) )
+ INVOKE_WCB( *window, MouseWheel,
+ ( wheel_number,
+ direction,
+ window->State.MouseX,
+ window->State.MouseY
+ )
+ );
+ else /* No mouse wheel, call the mouse button callback twice */
+ {
+ /*
+ * Map wheel zero to button 3 and 4; +1 to 3, -1 to 4
+ * " " one +1 to 5, -1 to 6, ...
+ *
+ * XXX The below assumes that you have no more than 3 mouse
+ * XXX buttons. Sorry.
+ */
+ int button = wheel_number * 2 + 3;
+ if( direction < 0 )
+ ++button;
+ INVOKE_WCB( *window, Mouse,
+ ( button, GLUT_DOWN,
+ window->State.MouseX, window->State.MouseY )
+ );
+ INVOKE_WCB( *window, Mouse,
+ ( button, GLUT_UP,
+ window->State.MouseX, window->State.MouseY )
+ );
+ }