> FGAPI void FGAPIENTRY glutJoystickConnectFunc(void
> (*joystickConnect)(int n));
> FGAPI void FGAPIENTRY glutJoystickDisconnectFunc(void
> (*joystickDisconnect)(int n));
> FGAPI void FGAPIENTRY glutJoystickButtonFunc(void
> (*joystickButton)(int n,int button));
> FGAPI void FGAPIENTRY glutJoystickButtonUpFunc(void
> (*joystickButtonUp)(int n,int button));
> FGAPI void FGAPIENTRY glutJoystickMotionFunc(void
> (*joystickMotion)(int n,int x,int y,int u,int v));
> (1) Are these window-specific callbacks or general callbacks (like the idle
> callback)?
It should follow the keyboard convention, I suppose.
A joystick is more like a keyboard than a mouse.
> (2) What do the arguments mean?
As I recall -
n The joystick
button Button number (upto 2^32 buttons)
x,y,u,v Four analog axes
Oh, and while we're thinking about it, converting analog axes to
float might also be an option:
FGAPI void FGAPIENTRY glutJoystickMotionFunc(void
(*joystickMotion)(int n,float x,float y,float u,float v));
Where x,y,u,v are [-1.0,1.0]
> (3) In view of the potentially increasing number of axes, would it be better
> for the motion function to have arguments ( int joystick_id, int num_axes,
> int *axis_values ) ?
More general, certainly.
Has anyone seen a joystick with more than four axes?
I'm averse to introducing pointers into the GLUT API.
I am particularly averse to having a 2D array of analog
axes for multiple joysticks.
We could simply eliminate joystick motion events, it doesn't
make sense to me to be polling the joystick state at a different
frequency to the frame rate. Perhaps a glutGet interface would
have the benefit of being more future-proof.
See the discusion at:
http://sourceforge.net/tracker/index.php?func=detail&aid=841360&group_id=1032&atid=351032
http://sourceforge.net/tracker/index.php?func=detail&aid=847170&group_id=1032&atid=351032
Overall, I think it is useful to receive button up/down events.
Analog axes need to be polled, as well as analog buttons.
Perhaps it is reasonable for the joystick state to be updated
within FreeGLUT once per frame. glutGet calls should basically
be fixed time...
Nigel
> -----Original Message-----
> From: freeglut-developer-admin@...
> [mailto:freeglut-developer-admin@... Behalf Of
> Nigel Stewart
> Sent: Thursday, February 05, 2004 7:14 PM
> To: freeglut-developer@...
> Subject: Re: [Freeglut-developer] Multiple Joysticks
>
>
>>I propose that we add an argument to "glutJoystickFunc" (and rename it) to
>>allow the application to specify which joystick the callback applies to.
>
> > Suggestions?
>
> When I looked into GLUT and FreeGLUT joystick handling, I
> put a few thoughts here:
>
> http://www.nigels.com/glt/news.html
>
> Generally, I thought that the API should be revised to
> support multiple joysticks and connect and disconnect events.
> The "legacy" callbacks would remain supported for the first
> detected joystick, I suppose.
>
> As the result of some discussion in relation to collaborative
> interaction or gaming applications - I realised that the same
> generality would also be useful for keyboard and mouse as
> well. Again, the "legacy" callbacks would be perfectly supported
> for less exotic applications.
>
> It was the one person, one mouse, one screen interaction model
> that we were particular interested in experimenting with, or
> rather, multi-person, multi input, one (big) screen.
>
> With the USB hot-plug kind of functionality these days, it makes
> sense to extend GLUT to generate the connect and disconnect
> events.
>
> Nigel
|