PDA

View Full Version : How to setup glutJoystickFunc



Stack Overflow
01-02-2003, 03:40 PM
Hello,

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

- VC6-OGL

Morglum
01-02-2003, 11:57 PM
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.

nutball
01-03-2003, 01:57 AM
Amongst GLFWs short-comings are lack of support for multiple windows. Until it has that, GLUT still has a place.

Morglum
01-03-2003, 05:49 AM
Yeah, but Marcus256 is planning to add that. I'm sure it'll be done before long.

Stack Overflow
01-03-2003, 06:26 AM
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

nutball
01-03-2003, 07:15 AM
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).

amendol
01-03-2003, 02:31 PM
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).]

amendol
01-03-2003, 02:38 PM
Originally posted by amendol:
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).]

marcus256
01-04-2003, 11:53 AM
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... http://www.opengl.org/discussion_boards/ubb/wink.gif 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.

nutball
01-06-2003, 12:21 AM
Originally posted by marcus256:
...I'm getting there, hold on... http://www.opengl.org/discussion_boards/ubb/wink.gif


That's great news! http://www.opengl.org/discussion_boards/ubb/biggrin.gif Once it happens I for one will be switching to GLFW!