Added state output for OpenTK.Input.Joystick

This commit is contained in:
Stefanos A 2013-12-24 15:01:33 +01:00 committed by thefiddler
parent 82a2c9113c
commit d33d0c7387

View file

@ -228,14 +228,31 @@ namespace Examples.Tests
int DrawGamePads(Graphics gfx, int line) int DrawGamePads(Graphics gfx, int line)
{ {
line++;
DrawString(gfx, "GamePads:", line++); DrawString(gfx, "GamePads:", line++);
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
GamePadCapabilities caps = GamePad.GetCapabilities(i); GamePadCapabilities caps = GamePad.GetCapabilities(i);
GamePadState state = GamePad.GetState(i); GamePadState state = GamePad.GetState(i);
if (state.IsConnected)
{
DrawString(gfx, caps.ToString(), line++); DrawString(gfx, caps.ToString(), line++);
DrawString(gfx, state.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; return line;
} }