public void AddGlobalDevices() { for (var i = 0; i < MaxSupportedDevices; i++) { GlobalGamepadInputSource gamepad = new GlobalGamepadInputSource(i); gamepad.UpdateState(); if (!gamepad.IsAvailable) { continue; } this.AddSource(gamepad); } }
public void AddGlobalDevices() { int deviceIndex = 0; while (true) { GlobalGamepadInputSource gamepad = new GlobalGamepadInputSource(deviceIndex); gamepad.UpdateState(); if (!gamepad.IsAvailable) { break; } this.AddSource(gamepad); deviceIndex++; } }
public void AddGlobalDevices() { const int MinDeviceCheckCount = 8; int deviceIndex = 0; while (true) { GlobalGamepadInputSource gamepad = new GlobalGamepadInputSource(deviceIndex); gamepad.UpdateState(); if (gamepad.IsAvailable) { this.AddSource(gamepad); } else if (deviceIndex >= MinDeviceCheckCount) { break; } deviceIndex++; } }