]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/js_demo.cxx
Merge branch 'torsten/proplist'
[flightgear.git] / src / Input / js_demo.cxx
index 904a4097d02eda65fca96f1a4c40b2166f899e3e..ee2b32e3011548a7dacbbd081f7df33ac08ceda8 100644 (file)
@@ -17,6 +17,8 @@ int main ( int, char ** )
   float      *ax[Z] ;
   int i, j, t, useful[Z];
 
+  jsInit();
+
   for ( i = 0; i < Z; i++ )
       js[i] = new jsJoystick ( i ) ;
 
@@ -26,9 +28,10 @@ int main ( int, char ** )
   t = 0;
   for ( i = 0; i < Z; i++ )
   { useful[i] = ! ( js[i]->notWorking () );
-    if ( useful[i] )
+    if ( useful[i] ) {
          t++;
-    else printf ( "Joystick %i not detected\n", i ) ;
+         printf ( "Joystick %i: \"%s\"\n", i, js[i]->getName() ) ;
+    } else printf ( "Joystick %i not detected\n", i ) ;
   }
   if ( t == 0 ) exit ( 1 ) ;
 
@@ -95,7 +98,7 @@ int main ( int, char ** )
 
     /* give other processes a chance */
 
-#ifdef WIN32
+#ifdef _WIN32
     Sleep ( 1 ) ;
 #elif defined(sgi)
     sginap ( 1 ) ;