home *** CD-ROM | disk | FTP | other *** search
/ Virtual Reality Madness / VRMAD96_ONE.ISO / virtek / libex / libex105.c < prev    next >
C/C++ Source or Header  |  1995-08-24  |  874b  |  22 lines

  1.                        // Example: 105 from Library Reference
  2. #include "..\3D-Ware\dddware.h"
  3. #include  <stdio.h>
  4. short  main(void)
  5. {
  6.   dddInitKeybd();      // Initialise the 3D-Ware key reading facilities.
  7.   while  (!dddkeycode) // Loop until a key is pressed.
  8.   {
  9.     dddReadJoystick(); // Read the joystick port.
  10.                        // Print the X value.
  11.     printf("Joystick Xpos is %d\t",joystick_x_position);
  12.                        // Print the Y value.
  13.     printf("Joystick Ypos is %d\t",joystick_y_position);
  14.                        // Print the left button state.
  15.     printf("Joystick button 1 is %d\t",joystick_left_button);
  16.                        // Print the right button state.
  17.     printf("Joystick button 2 is %d\n",joystick_right_button);
  18.   }
  19.   dddRestoreKeybd();   // Release the keyboard back to dos.
  20.   return 0;            // Bye.
  21. }
  22.