OpenGLEAN
OpenGLEAN User Support
Home page | Introduction | Documentation | Files | Examples | Proposals | Authors | Links


OpenGLEAN Device Support Development
Summary | CVS | (discussion via home page) | (contact via home page) | (suggestion box) | License | Todo | Bugs

Input State
[OpenGLEAN API Reference]

Collaboration diagram for Input State:


Functions

double gleandevGetd (GLenum eWhat)
float gleandevGetf (GLenum eWhat)
int gleandevGeti (GLenum eWhat)
void gleandevSetd (GLenum eWhat, double value)
void gleandevSetf (GLenum eWhat, float value)
void gleandevSeti (GLenum eWhat, int value)

Function Documentation

double gleandevGetd GLenum  eWhat  ) 
 

Allows you to get some device state/option variables.

Parameters:
eWhat Enumerated parameter ID.
Retrieves some system-specific information about attached devices. Supported device queries are:

  • GLUT_HAS_JOYSTICK Checks if a joystick is available.
  • GLUT_OWNS_JOYSTICK Checks if OpenGLEAN can use it.
  • GLUT_JOYSTICK_AXES Return the number of axes for the joystick.
  • GLUT_OWNS_JOYSTICK Return non-zero if OpenGLEAN believes that it has successfully acquired access to the joystick.

  • GLUT_HAS_SPACEBALL Return non-zero if there is a spaceball.
  • GLUT_NUM_SPACEBALL_BUTTONS Return the number of buttons on a spaceball, if any.

  • GLUT_HAS_DIAL_AND_BUTTON_BOX Return non-zero if a dials-and-buttons box is present.
  • GLUT_NUM_BUTTON_BOX_BUTTONS Return the number of buttons on a dials-and-buttons box, if any.
  • GLUT_NUM_DIALS Return the number of dials on a dials-and-buttons box, if any.

  • GLUT_HAS_TABLET Return non-zero if a tablet is present.
  • GLUT_NUM_TABLET_BUTTONS Return the number of buttons on a tablet, if any.

Note:
This is basically the OpenGLEAN glutDeviceGet() function with the mouse, keyboard, and callback related queries removed---and the return value of this function is double rather than int.
See also:
gleandevGetf(), gleandevGeti(), gleandevSetd()
Todo:
Consider moving to a table-based approach rather than a switch(), letting us move to modular functions.

Add queries for all of the other joystick parameters that are available in glut* functions in joystick.c.

Change the ogWarning() calls to silently set a queryable gleandev error-condition so that you can do something like gleandevGeti (GLEAN_GET_ERROR). There's really no need for this function to print anything.

Bug:
HAS/OWNS queries on joysticks don't report how many joysticks are there.

BUTTONS/AXES queres on joysticks only work with the first joystick found. We either need a "current joystick" concept or an additional parameter.

Only supports querying for one joystick. We either need a "current joystick" concept or else we need an additional parameter to set the joystick. Perhaps a gleandev[GS]et() call for GLEAN_CURRENT_JOYSTICK would be a good idea.

Here is the call graph for this function:

float gleandevGetf GLenum  eWhat  ) 
 

int version of gleanDevGetd().

Parameters:
eWhat The enumerated ID of the variable to fetch.
Returns the value of gleanDevGetd(), converted to floatt.

See also:
gleandevGetd(), gleandevGetf(), gleandevSetf()

Here is the call graph for this function:

int gleandevGeti GLenum  eWhat  ) 
 

float version of gleanDevGetd().

Parameters:
eWhat The enumerated ID of the variable to fetch.
Returns the value of gleanDevGetd(), converted to int.

Where gleandevGetd() returns unit scalars (i.e., numbers between 0 and 1), the result will be multiplied by INT_MAX. "Boolean" results might not be scaled, but the caller should only look for zero and non-zero for boolean queries.

See also:
gleandevGetd(), gleandevGetf(), gleandevSeti()

Here is the call graph for this function:

void gleandevSetd GLenum  eWhat,
double  value
 

Sets options for gleandev devices.

Parameters:
eWhat Option to set.
value New content for selected option.
This function is the flip side of gleandevGetd(), allowing you to set variables in the gleandev state.

Todo:
Change the ogWarning() calls to silently set a queryable gleandev error-condition so that you can do something like gleandevGeti (GLEAN_GET_ERROR). There's really no need for this function to print anything.

See also:
gleandevGetd(), gleandevSetf(), gleandevSeti()

Here is the call graph for this function:

void gleandevSetf GLenum  eWhat,
float  value
 

Sets options for gleandev devices.

Parameters:
eWhat Option to set.
value New content for selected option.
This function is the flip side of gleandevGetf(), allowing you to set variables in the gleandev state. The parameter, value, is converted to double and passed to gleandevSetd().

See also:
gleandevGetf(), gleandevSetd(), gleandevSeti()

Here is the call graph for this function:

void gleandevSeti GLenum  eWhat,
int  value
 

Sets options for gleandev devices.

Parameters:
eWhat Option to set.
value New content for selected option.
This function is the flip side of gleandevGeti(), allowing you to set variables in the gleandev state. The parameter, value, is converted to double and passed to gleandevSetd().

Where gleandevSetd() takes a value in the range 0..1 or -1..1, we should divide by INT_MAX (in floating point).

See also:
gleandevGeti(), gleandevSetd(), gleandevSetf()

Here is the call graph for this function:





SourceForge.net Logo Supported in part by SourceForge.net.

Generated on Fri Sep 9 18:01:35 2005 for gleandev by doxygen 1.4.3
The OpenGLEAN project is hosted in part by SourceForge.