From d33d0c7387cb2e9b13d34d842b36b30a154629d6 Mon Sep 17 00:00:00 2001 From: Stefanos A Date: Tue, 24 Dec 2013 15:01:33 +0100 Subject: [PATCH] Added state output for OpenTK.Input.Joystick --- .../Examples/OpenTK/Test/GameWindowStates.cs | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Source/Examples/OpenTK/Test/GameWindowStates.cs b/Source/Examples/OpenTK/Test/GameWindowStates.cs index 8359a552..aa9d27d2 100644 --- a/Source/Examples/OpenTK/Test/GameWindowStates.cs +++ b/Source/Examples/OpenTK/Test/GameWindowStates.cs @@ -228,14 +228,31 @@ namespace Examples.Tests int DrawGamePads(Graphics gfx, int line) { + line++; DrawString(gfx, "GamePads:", line++); for (int i = 0; i < 4; i++) { GamePadCapabilities caps = GamePad.GetCapabilities(i); GamePadState state = GamePad.GetState(i); - DrawString(gfx, caps.ToString(), line++); - DrawString(gfx, state.ToString(), line++); + if (state.IsConnected) + { + DrawString(gfx, caps.ToString(), line++); + DrawString(gfx, state.ToString(), line++); + } } + line++; + DrawString(gfx, "Joysticks:", line++); + for (int i = 0; i < 4; i++) + { + JoystickCapabilities caps = Joystick.GetCapabilities(i); + JoystickState state = Joystick.GetState(i); + if (state.IsConnected) + { + DrawString(gfx, caps.ToString(), line++); + DrawString(gfx, state.ToString(), line++); + } + } + return line; }