summaryrefslogtreecommitdiff
path: root/src/input_common/sdl/sdl_impl.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-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