Norman Vine writes:

 > Here is a start at a 'positionable' mouse that I find makes the new
 > mouse MUCH easier to deal with when switching modes and a
 > doMouseMotion() that is MUCH closer to what we had

Great, thanks.

 >   if (mode != m.current_mode) {
 >     m.current_mode = mode;
 >     glutWarpPointer( fgGetInt("/sim/startup/xsize", 800)/2,
 >                   fgGetInt("/sim/startup/ysize", 600)/2 );
 >     if (mode >= 0 && mode < m.nModes) {
 >       glutSetCursor(m.modes[mode].cursor);

Sounds good.  I've added the glutWarpPointer, but put it next to the
glutSetCursor in the conditional.  It should make no difference unless
the mouse is misconfigured anyway.

 >   if (mode.constrained) {
 >     bool need_warp = false;
 >     if (x <= 0) {
 >       x = xsize - 2;
 >       need_warp = true;
 >     } else if (x >= (xsize-1)) {
 >       x = 0;
 >       need_warp = true;
 >     }
 > 
 >     if (y <= 0) {
 >       y = 1;
 >       need_warp = true;
 >     } else if (y >= (ysize-1)) {
 >       y = ysize - 2;
 >       need_warp = true;
 >     }
 > 
 >     if (need_warp)
 >       glutWarpPointer(x, y);
 >   }
 >   m.x = x;
 >   m.y = y;
 > }

I'm not sure what you inteded here.  If the mouse hits the left side,
you have it wrap around to the right, but it freezes at the other
three edges.  I've guessed that the first one reflects what you
wanted, and changed the others accordingly.


Thanks, and all the best,


David

-- 
David Megginson
[EMAIL PROTECTED]


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to