Panda3D
|
00001 // Filename: dxInput9.h 00002 // Created by: blllyjo (07Oct99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef DXINPUT9_H 00016 #define DXINPUT9_H 00017 00018 #define DIRECTINPUT_VERSION 0x900 00019 #include <dinput.h> 00020 typedef vector<DIDEVICEINSTANCE> DI_DeviceInfos; 00021 typedef vector<DIDEVICEOBJECTINSTANCE> DI_DeviceObjInfos; 00022 00023 class DInput9Info { 00024 public: 00025 DInput9Info(); 00026 ~DInput9Info(); 00027 bool InitDirectInput(); 00028 bool CreateJoystickOrPad(HWND _window); 00029 bool ReadJoystick(int devnum, DIJOYSTATE2 &js); 00030 00031 HINSTANCE _hDInputDLL; 00032 UINT_PTR _JoystickPollTimer; 00033 LPDIRECTINPUT8 _pDInput9; 00034 DI_DeviceInfos _DevInfos; 00035 // arrays for all created devices. Should probably put these together in a struct, 00036 // along with the data fmt info 00037 vector<LPDIRECTINPUTDEVICE8> _DeviceList; 00038 vector<DIDEVCAPS> _DevCaps; 00039 }; 00040 00041 #endif 00042