Collaboration diagram for Joystick Access:
Functions | |
float | glutGetJoystickCenter (int ident, int axis) |
float | glutGetJoystickDeadBand (int ident, int axis) |
float | glutGetJoystickMaxRange (int ident, int axis) |
float | glutGetJoystickMinRange (int ident, int axis) |
int | glutGetJoystickNotWorking (int ident) |
int | glutGetJoystickNumAxes (int ident) |
int | glutGetJoystickNumButtons (int ident) |
float | glutGetJoystickSaturation (int ident, int axis) |
int | glutJoystickDetect (void) |
void | glutJoystickInit (void) |
void | glutJoystickOpen (int ident) |
float | glutJoystickReadAxis (int ident, int axis) |
int | glutJoystickReadButtons (int ident) |
void | glutJoystickShutdown (void) |
void | glutSetJoystickCenter (int ident, int axis, float nval) |
void | glutSetJoystickDeadBand (int ident, int axis, float db) |
void | glutSetJoystickMaxRange (int ident, int axis, float nval) |
void | glutSetJoystickMinRange (int ident, int axis, float nval) |
void | glutSetJoystickSaturation (int ident, int axis, float st) |
The old GLUT API for joysticks used timer-based pseudo-events. But ultimately, GLUT would poll the hardware for joystick events. A preferable API would perhaps have been to define functions to allow the application to poll the joystick, and let the application use GLUT timers scheduling the pseudo events, if timer-based checks are desired.
freeglut defined, but did not originally implement an extended API for pollinng the hardware. The definition was informal, in the form of stubbed out functions at the bottom of joystick.c. In 2004, John Fay re-implemented the freeglut joystick support, and added support for these stubbed functions.
OpenGLEAN inherited both of these API forms indirectly through OpenGLUT. OpenGLEAN had intended to expose and support these functions in a separate joystick-only library. In response to what seemed a consensus amongst freeglut developers to move forward with exporting that API, OpenGLEAN opted to expose the same API in order to avoid a compatibilit gap. After a month or two of discussion, but before any release from freeglut with this feature, OpenGLEAN finally added the functions---and literally on the same day, the freeglut project leader turned freeglut away from exporting the API.
On the one hand, this has resulted in OpenGLEAN adding under-designed features that freeglut seemed to want to include. On the other hand, now that freeglut is backing away from their API extension, and gleandev in a very experimental state, gleandev has revised the joystick API substantially.
The old GLUT API is still available in the OpenGLEAN core library as of this writing---and will remain so up through OpenGLEAN 1.0. But a more flexible API is now provided in gleandev.
The new API is two-pronged: One side is a revised set of functions (due to be renamed to avoid historic conflict with freeglut); these form a small constellation of joystick-related functions. The other side is a gleandevGet*() suite of functions, after the style of glGet*(), and likewise a gleandevSet*(). The latter part is more in keeping with OpenGL and the GLUT approach, so will probably be used in preference to the former---though a way to read multiple joystick axes at once (and perhaps support for arrays for reading multiple joystick buttons, rather than bitmasks) may be added.
See the Deprecated API Features section.
|
Retrieves the joystick's nominal at-rest position.
|
|
Returns the joystick's "dead band".
|
|
Get the joystick's maximum range.
|
|
Get the joystick's maximum range.
|
|
Returns 0 if the joystick is working.
glutGetJoystickNotWorking() returns 0 if the joystick is working, and non-zero if it is not working. If it is not working, no indication of why it fails will be provided. If a joystick transitions from working to noot working, there is no way to detect it except by querying again.
|
|
Returns the number proportional axes on a joystick.
glutGetJoystickNumAxes() queries the OpenGLEAN API for informaation about the number of axes on a given joystick.
|
|
Returns the number of boolean buttons on a joystick.
glutGetJoystickNumButtons() queries the OpenGLEAN API for informaation about the number of buttons on a given joystick.
|
|
Get the joystick's saturation.
|
|
Returns 0 if there are no joysticks. Through this function you can probe to see if there are one or more detectable joysticks that OpenGLEAN can talk to.
Here is the call graph for this function: |
|
Initializes the joystick portion of gleandev. This function is used to set up the joystick access. The current behavior is to just call glutJoystickOpen() twice; once with each of the joystick descriptors of 0 and 1. You are presently encouraged to call this function to initialize the joystick support. More likely in the future you will be expected to explicitly open joysticks and record the resulting identifiers.
Here is the call graph for this function: |
|
Opens a joystick by identifier number.
|
|
Read the corrected joystick axes data.
|
|
Read the joystick button data.
The returned value is a bit-mask, presently. Probably should be unsigned. Because of C's limitations, the exact number of buttons supported by this API depends upon your compiler.
|
|
Releases joystick resources. gleandev may have set up some internal resources or received exclusive access to system resources. When you are done with gleandev, you should close it down properly. This function closes all gleandev joystick resources.
|
|
Sets the joystick's nominal at-rest position.
|
|
Set the joystick's deadband.
|
|
Set the joystick's maximum range.
|
|
Set the joystick's minimum range.
|
|
Set the joystick's saturation.
|
Supported in part by SourceForge.net.
Generated on Fri Sep 9 18:01:36 2005 for gleandev by
doxygen 1.4.3
The OpenGLEAN project is hosted in part by
SourceForge.