From 5958db383d63d0112cf9eac41c0666da068741a7 Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Sun, 22 Dec 2013 23:13:21 +0100 Subject: [PATCH] Delay joystick initialization until necessary --- Source/OpenTK/Configuration.cs | 4 ++-- Source/OpenTK/Platform/SDL2/Sdl2InputDriver.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/OpenTK/Configuration.cs b/Source/OpenTK/Configuration.cs index 98aad59d..fcae8212 100644 --- a/Source/OpenTK/Configuration.cs +++ b/Source/OpenTK/Configuration.cs @@ -206,8 +206,8 @@ namespace OpenTK { if (!OpenTK.Platform.SDL2.SDL.WasInit(0)) { - var flags = OpenTK.Platform.SDL2.SystemFlags.EVERYTHING; - flags &= ~OpenTK.Platform.SDL2.SystemFlags.AUDIO; + var flags = + OpenTK.Platform.SDL2.SystemFlags.VIDEO | Platform.SDL2.SystemFlags.TIMER; if (OpenTK.Platform.SDL2.SDL.Init(flags) == 0) { supported = true; diff --git a/Source/OpenTK/Platform/SDL2/Sdl2InputDriver.cs b/Source/OpenTK/Platform/SDL2/Sdl2InputDriver.cs index de174875..d2fa0093 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2InputDriver.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2InputDriver.cs @@ -59,6 +59,7 @@ 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); } }