From 2f1a81da2c57d85e04bd5e1a304cb056cff8ccc6 Mon Sep 17 00:00:00 2001 From: Stefanos A Date: Sun, 22 Dec 2013 23:55:28 +0100 Subject: [PATCH] Log errors in subsystem initialization --- Source/OpenTK/Platform/SDL2/Sdl2InputDriver.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/OpenTK/Platform/SDL2/Sdl2InputDriver.cs b/Source/OpenTK/Platform/SDL2/Sdl2InputDriver.cs index d2fa0093..3a69be40 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2InputDriver.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2InputDriver.cs @@ -59,7 +59,14 @@ namespace OpenTK.Platform.SDL2 driver_handle = new IntPtr(count++); DriverHandles.Add(driver_handle, this); SDL.AddEventWatch(EventFilterDelegate, driver_handle); - SDL.InitSubSystem(SystemFlags.JOYSTICK | SystemFlags.GAMECONTROLLER); + if (SDL.InitSubSystem(SystemFlags.JOYSTICK) < 0) + { + Debug.Print("[SDL2] InputDriver failed to init Joystick subsystem. Error: {0}", SDL.GetError()); + } + if (SDL.InitSubSystem(SystemFlags.GAMECONTROLLER) < 0) + { + Debug.Print("[SDL2] InputDriver failed to init GameController subsystem. Error: {0}", SDL.GetError()); + } } }