aboutsummaryrefslogtreecommitdiff
path: root/src/input_common/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/input_common/main.cpp')
-rw-r--r--src/input_common/main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/input_common/main.cpp b/src/input_common/main.cpp
index 8455fdc176..699f41e6bc 100644
--- a/src/input_common/main.cpp
+++ b/src/input_common/main.cpp
@@ -7,6 +7,9 @@
#include "input_common/analog_from_button.h"
#include "input_common/keyboard.h"
#include "input_common/main.h"
+#ifdef HAVE_SDL2
+#include "input_common/sdl/sdl.h"
+#endif
namespace InputCommon {
@@ -17,12 +20,19 @@ void Init() {
Input::RegisterFactory<Input::ButtonDevice>("keyboard", keyboard);
Input::RegisterFactory<Input::AnalogDevice>("analog_from_button",
std::make_shared<InputCommon::AnalogFromButton>());
+#ifdef HAVE_SDL2
+ SDL::Init();
+#endif
}
void Shutdown() {
Input::UnregisterFactory<Input::ButtonDevice>("keyboard");
keyboard.reset();
Input::UnregisterFactory<Input::AnalogDevice>("analog_from_button");
+
+#ifdef HAVE_SDL2
+ SDL::Shutdown();
+#endif
}
Keyboard* GetKeyboard() {