Splitting out the platform-specific code from "fghJoystickInit"
[freeglut] / src / mswin / freeglut_joystick_mswin.c
index 2aad217..e154223 100644 (file)
 \r
 \r
 #if !defined(_WIN32_WCE)\r
+void fgPlatformJoystickInit( SFG_Joystick *fgJoystick[], int ident )\r
+{\r
+    switch( ident )\r
+    {\r
+    case 0:\r
+        fgJoystick[ ident ]->js_id = JOYSTICKID1;\r
+        fgJoystick[ ident ]->error = GL_FALSE;\r
+        break;\r
+    case 1:\r
+        fgJoystick[ ident ]->js_id = JOYSTICKID2;\r
+        fgJoystick[ ident ]->error = GL_FALSE;\r
+        break;\r
+    default:\r
+        fgJoystick[ ident ]->num_axes = 0;\r
+        fgJoystick[ ident ]->error = GL_TRUE;\r
+        return;\r
+    }\r
+}\r
+\r
+\r
+\r
 void fgPlatformJoystickClose ( int ident )\r
 {\r
     /* Do nothing special */\r