31 lines
744 B
C++
31 lines
744 B
C++
#pragma once
|
|
|
|
// No MFC
|
|
#define WIN32_LEAN_AND_MEAN
|
|
//#define _WIN32_WINNT _WIN32_WINNT_WIN7
|
|
// We need the Windows Header and the XInput Header
|
|
//#include <windows.h>
|
|
//#include <XInput.h>
|
|
|
|
|
|
//#pragma comment(lib, "xinput1_3.lib")
|
|
// XBOX Controller Class Definition
|
|
class CXDirectXInput
|
|
{
|
|
private:
|
|
// XINPUT_STATE _controllerState;
|
|
int _controllerNum;
|
|
public:
|
|
CXDirectXInput();
|
|
~CXDirectXInput();
|
|
HRESULT InitDirectInput();
|
|
VOID FreeDirectInput();
|
|
HRESULT UpdateInputState();
|
|
HRESULT SetupForIsXInputDevice();
|
|
void Vibrate(int leftVal = 0, int rightVal = 0);
|
|
bool IsXInputDevice( const GUID* pGuidProductFromDirectInput );
|
|
void CleanupForIsXInputDevice();
|
|
DIJOYSTATE2 GetState();
|
|
bool GetState(DIJOYSTATE2 &joyState);
|
|
};
|