joystick updates from John Fay
[freeglut] / src / freeglut_callbacks.c
index d7c998a..3e19c3e 100644 (file)
@@ -171,6 +171,13 @@ void FGAPIENTRY glutJoystickFunc( void (* callback)
                                   ( unsigned int, int, int, int ),
                                   int pollInterval )
 {
+    if( !fgState.JoysticksInitialised )
+    {
+        fgJoystickInit( 0 );
+        fgJoystickInit( 1 );
+        fgState.JoysticksInitialised = GL_TRUE;
+    }
+
     SET_CALLBACK( Joystick );
     fgStructure.Window->State.JoystickPollRate = pollInterval;