diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2024-03-11 02:09:31 -0500 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2024-03-11 03:25:31 -0500 |
| commit | 341f99a3f1feaf981bb704909b2dc3b3a0b70245 (patch) | |
| tree | f89283b8a76ff7dea79487032a9ef23d2fb54461 /Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | |
| parent | 2ac59bf5813ab44dc3e7f067913b0e951e8b6199 (diff) | |
InputCommon: Add Win32 InputBackend class.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 71dea5512c..8f7bed3af1 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -59,7 +59,7 @@ void ControllerInterface::Initialize(const WindowSystemInfo& wsi) m_populating_devices_counter = 1; #ifdef CIFACE_USE_WIN32 - ciface::Win32::Init(wsi.render_window); + m_input_backends.emplace_back(ciface::Win32::CreateInputBackend(this)); #endif #ifdef CIFACE_USE_XLIB m_input_backends.emplace_back(ciface::XInput2::CreateInputBackend(this)); @@ -135,9 +135,8 @@ void ControllerInterface::RefreshDevices(RefreshReason reason) { m_populating_devices_counter.fetch_add(1); - // No need to do anything else in this case. - // Only (Win32) DInput needs the window handle to be updated. - ciface::Win32::ChangeWindow(m_wsi.render_window); + for (auto& backend : m_input_backends) + backend->HandleWindowChange(); if (m_populating_devices_counter.fetch_sub(1) == 1) InvokeDevicesChangedCallbacks(); @@ -159,9 +158,6 @@ void ControllerInterface::RefreshDevices(RefreshReason reason) // do it async, to not risk the emulated controllers default config loading not finding a default // device. -#ifdef CIFACE_USE_WIN32 - ciface::Win32::PopulateDevices(m_wsi.render_window); -#endif #ifdef CIFACE_USE_ANDROID ciface::Android::PopulateDevices(); #endif @@ -204,9 +200,6 @@ void ControllerInterface::Shutdown() // Update control references so shared_ptr<Device>s are freed up BEFORE we shutdown the backends. ClearDevices(); -#ifdef CIFACE_USE_WIN32 - ciface::Win32::DeInit(); -#endif #ifdef CIFACE_USE_ANDROID ciface::Android::Shutdown(); #endif |
