Panda3D
dxInput9.h
1 // Filename: dxInput9.h
2 // Created by: blllyjo (07Oct99)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef DXINPUT9_H
16 #define DXINPUT9_H
17 
18 #define DIRECTINPUT_VERSION 0x900
19 #include <dinput.h>
20 typedef vector<DIDEVICEINSTANCE> DI_DeviceInfos;
21 typedef vector<DIDEVICEOBJECTINSTANCE> DI_DeviceObjInfos;
22 
23 class DInput9Info {
24 public:
25  DInput9Info();
26  ~DInput9Info();
27  bool InitDirectInput();
28  bool CreateJoystickOrPad(HWND _window);
29  bool ReadJoystick(int devnum, DIJOYSTATE2 &js);
30 
31  HINSTANCE _hDInputDLL;
32  UINT_PTR _JoystickPollTimer;
33  LPDIRECTINPUT8 _pDInput9;
34  DI_DeviceInfos _DevInfos;
35  // arrays for all created devices. Should probably put these together in a struct,
36  // along with the data fmt info
37  vector<LPDIRECTINPUTDEVICE8> _DeviceList;
38  vector<DIDEVCAPS> _DevCaps;
39 };
40 
41 #endif
42