ControllerInterface: Add XInput controller backend

This commit is contained in:
Connor McLaughlin
2020-08-22 16:44:06 +10:00
parent 62d0ec5584
commit 3c46f7b44c
18 changed files with 600 additions and 45 deletions

View File

@ -3,6 +3,7 @@
#include "core/types.h"
#include <array>
#include <functional>
#include <optional>
#include <map>
#include <mutex>
@ -12,6 +13,18 @@ class Controller;
class ControllerInterface
{
public:
enum class Backend
{
None,
#ifdef WITH_SDL2
SDL,
#endif
#ifdef WIN32
XInput,
#endif
Count
};
enum : int
{
MAX_NUM_AXISES = 7,
@ -24,6 +37,12 @@ public:
ControllerInterface();
virtual ~ControllerInterface();
static std::optional<Backend> ParseBackendName(const char* name);
static const char* GetBackendName(Backend type);
static Backend GetDefaultBackend();
static std::unique_ptr<ControllerInterface> Create(Backend type);
virtual Backend GetBackend() const = 0;
virtual bool Initialize(CommonHostInterface* host_interface);
virtual void Shutdown();