Rise
The Vieneo Province
joystick.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <WinSock2.h>
4 #include <WS2tcpip.h>
5 #include <Windows.h>
6 #include "DXUT.h"
7 #include "../Logger.h"
8 #include <dinput.h>
9 #include <vector>
10 #include "../Config/InputConfig.h"
11 #include "../Networking.h"
12 
13 class Viewscreen;
14 
15 class joystick
16 {
17 public:
18  joystick(Viewscreen* ptr);
19 
20  HRESULT Poll(InputConfig* config, long* value, DIJOYSTATE* js) const;
21  void Update(float fElapsedTime) const;
22  void InitializeDevice(InputConfig* config, std::string control);
23  void Initialize(HWND prmHWND);
24  HRESULT EnumDevices();
25  bool IsGameController(WCHAR* deviceName) const;
26 
27  std::vector<DIDEVICEINSTANCE> deviceList;
28  const int nullzone = 50;
29 
30 private:
33  HWND hDlg;
34 
35  struct Wrapper
36  {
40  };
41 
42  static BOOL CALLBACK EnumAxesCallback(const DIDEVICEOBJECTINSTANCE* pdidoi, VOID* pContext);
43  static BOOL CALLBACK EnumDevicesCallback(const DIDEVICEINSTANCE* pInst, VOID* pContext);
44 
45  //HRESULT SetDeviceForcesXY() const;
46 
47  /*
48 
49  LPDIRECTINPUTEFFECT g_pEffectCF; // Constant-forces
50  LPDIRECTINPUTEFFECT g_pEffectSS; // Stick-shaker
51  DWORD g_dwNumForceFeedbackAxis;
52  int g_nXForce;
53  int g_nYForce;
54 
55  */
56 };
HRESULT EnumDevices()
Definition: joystick.cpp:350
void Initialize(HWND prmHWND)
Definition: joystick.cpp:325
InputConfig * config
Definition: joystick.h:37
Logger * logger
Definition: joystick.h:32
std::vector< DIDEVICEINSTANCE > deviceList
Definition: joystick.h:27
HRESULT Poll(InputConfig *config, long *value, DIJOYSTATE *js) const
Definition: joystick.cpp:13
Definition: Logger.h:9
void InitializeDevice(InputConfig *config, std::string control)
Definition: joystick.cpp:369
HWND hDlg
Definition: joystick.h:33
void Update(float fElapsedTime) const
Definition: joystick.cpp:84
joystick(Viewscreen *ptr)
Definition: joystick.cpp:6
bool IsGameController(WCHAR *deviceName) const
Logger * logger
Definition: joystick.h:38
Viewscreen * viewscreen
Definition: joystick.h:31
static BOOL CALLBACK EnumDevicesCallback(const DIDEVICEINSTANCE *pInst, VOID *pContext)
Definition: joystick.cpp:899
static BOOL CALLBACK EnumAxesCallback(const DIDEVICEOBJECTINSTANCE *pdidoi, VOID *pContext)
Definition: joystick.cpp:858
GameClass * game
Definition: joystick.h:39
const int nullzone
Definition: joystick.h:28