[HID/Linux] Implement cross platform controller input using SDL2 library.

This commit is contained in:
Joel Linn
2019-10-19 17:10:19 +02:00
committed by Rick Gibbed
parent 498b73612f
commit 64f3925c7d
10 changed files with 585 additions and 4 deletions

View File

@@ -34,6 +34,7 @@ project("xenia-app")
"xenia-gpu-vulkan",
"xenia-hid",
"xenia-hid-nop",
"xenia-hid-sdl",
"xenia-kernel",
"xenia-ui",
"xenia-ui-spirv",

View File

@@ -2,7 +2,7 @@
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2019 Ben Vanik. All rights reserved. *
* Copyright 2020 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
@@ -37,6 +37,7 @@
// Available input drivers:
#include "xenia/hid/nop/nop_hid.h"
#include "xenia/hid/sdl/sdl_hid.h"
#if XE_PLATFORM_WIN32
#include "xenia/hid/winkey/winkey_hid.h"
#include "xenia/hid/xinput/xinput_hid.h"
@@ -47,7 +48,7 @@
DEFINE_string(apu, "any", "Audio system. Use: [any, nop, xaudio2]", "APU");
DEFINE_string(gpu, "any",
"Graphics system. Use: [any, d3d12, vulkan, vk, null]", "GPU");
DEFINE_string(hid, "any", "Input system. Use: [any, nop, winkey, xinput]",
DEFINE_string(hid, "any", "Input system. Use: [any, nop, sdl, winkey, xinput]",
"HID");
DEFINE_bool(fullscreen, false, "Toggles fullscreen", "GPU");
@@ -179,6 +180,7 @@ std::vector<std::unique_ptr<hid::InputDriver>> CreateInputDrivers(
// WinKey input driver should always be the last input driver added!
factory.Add("winkey", xe::hid::winkey::Create);
#endif // XE_PLATFORM_WIN32
factory.Add("sdl", xe::hid::sdl::Create);
for (auto& driver : factory.CreateAll(cvars::hid, window)) {
if (XSUCCEEDED(driver->Setup())) {
drivers.emplace_back(std::move(driver));