How to setup glutJoystickFunc

Hello,

Is there a way to setup glutJoystickFunc, so when I press a button on my joystick it recognizes it?

  • VC6-OGL

honnestly, you should dump glut and use glfw instead. It does most of what glut does (including joystick support), has much, much less bugs and is simpler to use.

Amongst GLFWs short-comings are lack of support for multiple windows. Until it has that, GLUT still has a place.

Yeah, but Marcus256 is planning to add that. I’m sure it’ll be done before long.

Back to the Question, how do you initialize glutJoystickFunc? I searched Yahoo, but nothing showed up, so I was wondering if any of you knew how to set it up.

  • VC6-OGL

Did you try Google? When I tried Google I found this:
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=glutjoystickfunc&btnG=Google+Search

Some of the links point to the documentation which comes with GLUT (ie. glut-3.7/man/glut/glutJoystickFunc.man).

It’s my understanding that the joystick code for glut is unimplemented – (at least under linux, not sure for windows). I got the joystick to work by spawning a thread that does a blocked read of joystick data.

The joystick data is fed into the system durring the glut - idle call.

This method seems to work very well, and is really simple.

Jamie

[This message has been edited by amendol (edited 01-03-2003).]

Originally posted by amendol:
[b]It’s my understanding that the joystick code for glut is unimplemented – (at least under linux, not sure for windows). I got the joystick to work by spawning a thread that does a blocked read of joystick data.

The joystick data is fed into the system durring the glut - idle call.

This method seems to work very well, and is really simple.

Jamie

Looking at the man pages for glut in linux I get this:

GLUT IMPLEMENTATION NOTES FOR X11
The GLUT 3.7 implementation of glut for X11 supports the joystick API, but not joystick input. A future implementation of GLUT for X11 may add joystick support.

[This message has been edited by amendol (edited 01-03-2003).][/b]

Originally posted by nutball:
Amongst GLFWs short-comings are lack of support for multiple windows. Until it has that, GLUT still has a place.

…I’m getting there, hold on… Well, the current priority (due to various reasons) is Mac OS X support (check Macintosh forum for more info), and a major source code layout change, and internationalized Unicode keyboard input (up yours, GLUT!). The next step will porbably be support for multiple windows (much of the GLFW code is ready for the leap, but there are some philosophical questions yet to be answered).

Regarding GLUT joystick support, check this: http://pyopengl.sourceforge.net/documentation/manual/glutJoystickFunc.3GLUT.html

I seriously doubt that GLUT will get joystick support under anything but Windows (GLUT is really suffering from severe rigor mortis). Besides, the GLUT joystick interface is quite sucky (max one stick with max three axes).

Sidenote: GLFW supports joysticks under Windows (9x/ME/NT/2k/XP/.NET) and Linux (I haven’t found a standard joystick interface for any other Un*x variant yet). GLFW API limits: 16 sticks, unlimited number of axes and buttons.

Originally posted by marcus256:
…I’m getting there, hold on…

That’s great news! Once it happens I for one will be switching to GLFW!