Richard Rauch - 2003-11-14

Logged In: YES
user_id=854844

Instead of fixing 2 or 3 or 4 axes, may I suggest that the
callback be passed an *array* of axes and an integer count
of how many axes there are?

Also, if we register one callback, once, for all joysticks,
on one poll interval, perhaps it would make sense to give
invoke the one callback once for *all* of the joysticks?
The above API suggestion would presumably result in N
invocations for N joysticks. Why not one invocation with
N*M axes (M axes per joystick)? This would help a lot in
dealing with the question of "When do I have all of my
joystick data in-hand so that I can process some of it?"
(You may not want to give favoritism to the one joystick
over another by processing one before you've had a chance to
see the other.)

I'd suggest:

void glutJoystickFuncEx( void (*callback) (int *axes,
unsigned sticks, unsigned axes_per_stick));

The n^{th} axis of the m^{th} stick would then be given by

axes[m*axes_per_stick + n], for
0 <= m < sticks, and
0 <= n < axes_per_stick.