diff options
| author | 2018-09-22 14:11:15 -0600 | |
|---|---|---|
| committer | 2019-03-02 18:38:11 +0100 | |
| commit | c8554d218b11b7af081c0b836991ffb94ae003bb (patch) | |
| tree | 5a0f15777e2be1ca240387ee4c5eee3dc663d8c0 /src/input_common/sdl/sdl_impl.h | |
| parent | Merge pull request #2186 from honzapatCZ/patch-1 (diff) | |
| download | yuzu-c8554d218b11b7af081c0b836991ffb94ae003bb.tar.gz yuzu-c8554d218b11b7af081c0b836991ffb94ae003bb.tar.xz yuzu-c8554d218b11b7af081c0b836991ffb94ae003bb.zip | |
Input: Copy current SDL.h/cpp files to impl
This should make reviewing much easier as you can then see what changed
happened between the old file and the new one
Diffstat (limited to '')
| -rw-r--r-- | src/input_common/sdl/sdl_impl.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/input_common/sdl/sdl_impl.h b/src/input_common/sdl/sdl_impl.h new file mode 100644 index 000000000..c152fa747 --- /dev/null +++ b/src/input_common/sdl/sdl_impl.h | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | // Copyright 2017 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <memory> | ||
| 8 | #include <vector> | ||
| 9 | #include "core/frontend/input.h" | ||
| 10 | |||
| 11 | union SDL_Event; | ||
| 12 | namespace Common { | ||
| 13 | class ParamPackage; | ||
| 14 | } | ||
| 15 | namespace InputCommon { | ||
| 16 | namespace Polling { | ||
| 17 | class DevicePoller; | ||
| 18 | enum class DeviceType; | ||
| 19 | } // namespace Polling | ||
| 20 | } // namespace InputCommon | ||
| 21 | |||
| 22 | namespace InputCommon { | ||
| 23 | namespace SDL { | ||
| 24 | |||
| 25 | /// Initializes and registers SDL device factories | ||
| 26 | void Init(); | ||
| 27 | |||
| 28 | /// Unresisters SDL device factories and shut them down. | ||
| 29 | void Shutdown(); | ||
| 30 | |||
| 31 | /// Needs to be called before SDL_QuitSubSystem. | ||
| 32 | void CloseSDLJoysticks(); | ||
| 33 | |||
| 34 | /// Handle SDL_Events for joysticks from SDL_PollEvent | ||
| 35 | void HandleGameControllerEvent(const SDL_Event& event); | ||
| 36 | |||
| 37 | /// A Loop that calls HandleGameControllerEvent until Shutdown is called | ||
| 38 | void PollLoop(); | ||
| 39 | |||
| 40 | /// Creates a ParamPackage from an SDL_Event that can directly be used to create a ButtonDevice | ||
| 41 | Common::ParamPackage SDLEventToButtonParamPackage(const SDL_Event& event); | ||
| 42 | |||
| 43 | namespace Polling { | ||
| 44 | |||
| 45 | /// Get all DevicePoller that use the SDL backend for a specific device type | ||
| 46 | void GetPollers(InputCommon::Polling::DeviceType type, | ||
| 47 | std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>>& pollers); | ||
| 48 | |||
| 49 | } // namespace Polling | ||
| 50 | } // namespace SDL | ||
| 51 | } // namespace InputCommon | ||