diff options
Diffstat (limited to 'src/input_common/sdl/sdl_impl.cpp')
| -rw-r--r-- | src/input_common/sdl/sdl_impl.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index 934339d3b..b132d77f5 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp | |||
| @@ -475,12 +475,11 @@ SDLState::SDLState() { | |||
| 475 | 475 | ||
| 476 | initialized = true; | 476 | initialized = true; |
| 477 | if (start_thread) { | 477 | if (start_thread) { |
| 478 | poll_thread = std::thread([&] { | 478 | poll_thread = std::thread([this] { |
| 479 | using namespace std::chrono_literals; | 479 | using namespace std::chrono_literals; |
| 480 | SDL_Event event; | ||
| 481 | while (initialized) { | 480 | while (initialized) { |
| 482 | SDL_PumpEvents(); | 481 | SDL_PumpEvents(); |
| 483 | std::this_thread::sleep_for(std::chrono::duration(10ms)); | 482 | std::this_thread::sleep_for(10ms); |
| 484 | } | 483 | } |
| 485 | }); | 484 | }); |
| 486 | } | 485 | } |
| @@ -651,9 +650,9 @@ private: | |||
| 651 | }; | 650 | }; |
| 652 | } // namespace Polling | 651 | } // namespace Polling |
| 653 | 652 | ||
| 654 | std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> SDLState::GetPollers( | 653 | SDLState::Pollers SDLState::GetPollers(InputCommon::Polling::DeviceType type) { |
| 655 | InputCommon::Polling::DeviceType type) { | 654 | Pollers pollers; |
| 656 | std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> pollers; | 655 | |
| 657 | switch (type) { | 656 | switch (type) { |
| 658 | case InputCommon::Polling::DeviceType::Analog: | 657 | case InputCommon::Polling::DeviceType::Analog: |
| 659 | pollers.emplace_back(std::make_unique<Polling::SDLAnalogPoller>(*this)); | 658 | pollers.emplace_back(std::make_unique<Polling::SDLAnalogPoller>(*this)); |
| @@ -661,8 +660,9 @@ std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> SDLState::GetPo | |||
| 661 | case InputCommon::Polling::DeviceType::Button: | 660 | case InputCommon::Polling::DeviceType::Button: |
| 662 | pollers.emplace_back(std::make_unique<Polling::SDLButtonPoller>(*this)); | 661 | pollers.emplace_back(std::make_unique<Polling::SDLButtonPoller>(*this)); |
| 663 | break; | 662 | break; |
| 664 | return pollers; | ||
| 665 | } | 663 | } |
| 664 | |||
| 665 | return pollers; | ||
| 666 | } | 666 | } |
| 667 | 667 | ||
| 668 | } // namespace SDL | 668 | } // namespace SDL |