From 8e5faec07c4db0c418c485806f83b087a93d21d4 Mon Sep 17 00:00:00 2001 From: Rosen Iliev Date: Wed, 30 Aug 2017 18:10:56 +0300 Subject: [PATCH 1/2] Prevent crash when XInput is not present Now returns from the function instead of throwing an exception --- src/OpenTK/Platform/Windows/XInputJoystick.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OpenTK/Platform/Windows/XInputJoystick.cs b/src/OpenTK/Platform/Windows/XInputJoystick.cs index bf17115c..23d29d2c 100644 --- a/src/OpenTK/Platform/Windows/XInputJoystick.cs +++ b/src/OpenTK/Platform/Windows/XInputJoystick.cs @@ -381,7 +381,8 @@ namespace OpenTK.Platform.Windows } if (dll == IntPtr.Zero) { - throw new NotSupportedException("XInput was not found on this platform"); + //XInput was not found on this platform + return; } // Load the entry points we are interested in from that dll From 33ed6727bf2e97174c7e87c7d7c5ebc646c4ee32 Mon Sep 17 00:00:00 2001 From: Rosen Iliev Date: Thu, 31 Aug 2017 10:47:56 +0300 Subject: [PATCH 2/2] Update XInputJoystick.cs Debug message for programmers --- src/OpenTK/Platform/Windows/XInputJoystick.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTK/Platform/Windows/XInputJoystick.cs b/src/OpenTK/Platform/Windows/XInputJoystick.cs index 23d29d2c..a51cc48f 100644 --- a/src/OpenTK/Platform/Windows/XInputJoystick.cs +++ b/src/OpenTK/Platform/Windows/XInputJoystick.cs @@ -381,7 +381,7 @@ namespace OpenTK.Platform.Windows } if (dll == IntPtr.Zero) { - //XInput was not found on this platform + Debug.Print("XInput was not found on this platform"); return; }