Added state information for GamePads

This commit is contained in:
Stefanos A. 2013-12-22 22:07:40 +01:00
parent ef580daf75
commit 487e67473f

View file

@ -239,6 +239,8 @@ namespace Examples.Tests
DrawKeyboard(gfx, keyboard, line++);
DrawMouse(gfx, mouse, line++);
DrawJoysticks(gfx, Joysticks, line++);
line = DrawGamePads(gfx, line);
}
}
@ -250,6 +252,18 @@ namespace Examples.Tests
TextBitmap.UnlockBits(data);
}
int DrawGamePads(Graphics gfx, int 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++);
}
return line;
}
protected override void OnLoad(EventArgs e)
{