00001 /*************************************************************************** 00002 *cr 00003 *cr (C) Copyright 1995-2019 The Board of Trustees of the 00004 *cr University of Illinois 00005 *cr All Rights Reserved 00006 *cr 00007 ***************************************************************************/ 00008 /*************************************************************************** 00009 * RCS INFORMATION: 00010 * 00011 * $RCSfile: Win32Joystick.h,v $ 00012 * $Author: johns $ $Locker: $ $State: Exp $ 00013 * $Revision: 1.19 $ $Date: 2020/02/26 14:40:13 $ 00014 * 00015 ***************************************************************************/ 00021 #ifndef WIN32JOYSTICK_OBJ_H 00022 #define WIN32JOYSTICK_OBJ_H 00023 00024 #include "UIObject.h" 00025 #include "Command.h" 00026 #include "NameList.h" 00027 #include "windows.h" // Base Windows types/includes 00028 #include "mmsystem.h" // Windows joystick API 00029 00031 typedef struct { 00032 int exists; 00033 int avail; 00034 JOYCAPS caps; 00035 JOYINFOEX info; 00036 int xrange; 00037 int yrange; 00038 int zrange; 00039 int vx; 00040 int vy; 00041 int vz; 00042 int moveMode; 00043 int buttons; 00044 int buttonchanged; 00045 } vmdwinjoystick; 00046 00047 00049 class Win32Joystick : public UIObject { 00050 public: 00052 enum MoveMode { OFF, ROTATION, TRANSLATION, SCALING, USER}; 00053 00054 private: 00055 int maxjoys; // max joysticks supported by windows driver 00056 vmdwinjoystick *sticks; // array of joysticks 00057 float transInc; // increment for translation 00058 float rotInc; // increment for rotation 00059 float scaleInc; // increment for scaling 00060 float scaling; // scale factor 00061 00062 public: 00063 Win32Joystick(VMDApp *); 00064 virtual ~Win32Joystick(void); 00065 00066 // 00067 // virtual routines for UI init/display 00068 // 00069 00071 virtual void reset(void); 00072 00077 virtual int act_on_command(int, Command *); 00078 00080 virtual int check_event(void); 00081 }; 00082 00083 #endif 00084