summaryrefslogtreecommitdiff
path: root/src/input_common/sdl/sdl_impl.h
diff options
context:
space:
mode:
authorGravatar James Rowe2018-09-22 14:11:15 -0600
committerGravatar fearlessTobi2019-03-02 18:38:11 +0100
commitc8554d218b11b7af081c0b836991ffb94ae003bb (patch)
tree5a0f15777e2be1ca240387ee4c5eee3dc663d8c0 /src/input_common/sdl/sdl_impl.h
parentMerge pull request #2186 from honzapatCZ/patch-1 (diff)
downloadyuzu-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 'src/input_common/sdl/sdl_impl.h')
-rw-r--r--src/input_common/sdl/sdl_impl.h51
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
11union SDL_Event;
12namespace Common {
13class ParamPackage;
14}
15namespace InputCommon {
16namespace Polling {
17class DevicePoller;
18enum class DeviceType;
19} // namespace Polling
20} // namespace InputCommon
21
22namespace InputCommon {
23namespace SDL {
24
25/// Initializes and registers SDL device factories
26void Init();
27
28/// Unresisters SDL device factories and shut them down.
29void Shutdown();
30
31/// Needs to be called before SDL_QuitSubSystem.
32void CloseSDLJoysticks();
33
34/// Handle SDL_Events for joysticks from SDL_PollEvent
35void HandleGameControllerEvent(const SDL_Event& event);
36
37/// A Loop that calls HandleGameControllerEvent until Shutdown is called
38void PollLoop();
39
40/// Creates a ParamPackage from an SDL_Event that can directly be used to create a ButtonDevice
41Common::ParamPackage SDLEventToButtonParamPackage(const SDL_Event& event);
42
43namespace Polling {
44
45/// Get all DevicePoller that use the SDL backend for a specific device type
46void 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