git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@863
7f0cb862-5218-0410-a997-
914c9d46530a
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickFunc" );
fgInitialiseJoysticks ();
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutJoystickFunc" );
fgInitialiseJoysticks ();
+ if ( ( ( fgStructure.CurrentWindow->State.JoystickPollRate < 0 ) ||
+ !FETCH_WCB(*fgStructure.CurrentWindow,Joystick) ) && /* Joystick callback was disabled */
+ ( callback && ( pollInterval >= 0 ) ) ) /* but is now enabled */
+ ++fgState.NumActiveJoysticks;
+ else if ( ( ( fgStructure.CurrentWindow->State.JoystickPollRate >= 0 ) &&
+ FETCH_WCB(*fgStructure.CurrentWindow,Joystick) ) && /* Joystick callback was enabled */
+ ( !callback || ( pollInterval < 0 ) ) ) /* but is now disabled */
+ --fgState.NumActiveJoysticks;
+
SET_CALLBACK( Joystick );
fgStructure.CurrentWindow->State.JoystickPollRate = pollInterval;
SET_CALLBACK( Joystick );
fgStructure.CurrentWindow->State.JoystickPollRate = pollInterval;
GLUT_EXEC_STATE_INIT, /* ExecState */
NULL, /* ProgramName */
GL_FALSE, /* JoysticksInitialised */
GLUT_EXEC_STATE_INIT, /* ExecState */
NULL, /* ProgramName */
GL_FALSE, /* JoysticksInitialised */
+ 0, /* NumActiveJoysticks */
GL_FALSE, /* InputDevsInitialised */
1, /* AuxiliaryBufferNumber */
4, /* SampleNumber */
GL_FALSE, /* InputDevsInitialised */
1, /* AuxiliaryBufferNumber */
4, /* SampleNumber */
#else
# error "Unrecognized target host!"
#else
# error "Unrecognized target host!"
fgExecutionState ExecState; /* Used for GLUT termination */
char *ProgramName; /* Name of the invoking program */
GLboolean JoysticksInitialised; /* Only initialize if application calls for them */
fgExecutionState ExecState; /* Used for GLUT termination */
char *ProgramName; /* Name of the invoking program */
GLboolean JoysticksInitialised; /* Only initialize if application calls for them */
+ int NumActiveJoysticks; /* Number of active joysticks -- if zero, don't poll joysticks */
GLboolean InputDevsInitialised; /* Only initialize if application calls for them */
int AuxiliaryBufferNumber; /* Number of auxiliary buffers */
GLboolean InputDevsInitialised; /* Only initialize if application calls for them */
int AuxiliaryBufferNumber; /* Number of auxiliary buffers */