project64/Source/Project64-input/CProject64Input.h

39 lines
1.2 KiB
C
Raw Normal View History

2020-06-23 07:47:46 +00:00
#pragma once
#include "ControllerSpec1.1.h"
#include "DirectInput.h"
#include "N64Controller.h"
#include <Common\CriticalSection.h>
2020-06-23 07:47:46 +00:00
#include <memory>
class CProject64Input
{
public:
CProject64Input(HINSTANCE hinst);
~CProject64Input();
void InitiateControllers(CONTROL_INFO * ControlInfo);
void StartScanDevices(int32_t DisplayCtrlId);
void EndScanDevices(void);
CDirectInput::ScanResult ScanDevices(BUTTON & Button);
std::wstring ButtonAssignment(BUTTON & Button);
bool SaveController(uint32_t ControlIndex);
2020-06-23 07:47:46 +00:00
inline HINSTANCE hInst(void) const { return m_hinst; }
inline bool IsScanning(void) const { return m_Scanning; }
inline int32_t DisplayCtrlId(void) const { return m_DisplayCtrlId; }
inline N64CONTROLLER & Controllers(int32_t Controller) { return m_Controllers[Controller]; }
private:
CProject64Input();
CProject64Input(const CProject64Input&);
CProject64Input& operator=(const CProject64Input&);
CriticalSection m_CS;
2020-06-23 07:47:46 +00:00
N64CONTROLLER m_Controllers[4];
std::unique_ptr<CDirectInput> m_DirectInput;
HINSTANCE m_hinst;
bool m_Scanning;
int32_t m_DisplayCtrlId;
};
extern CProject64Input * g_InputPlugin;