예제 #1
0
        public void AddGlobalDevices()
        {
            for (var i = 0; i < MaxSupportedDevices; i++)
            {
                GlobalGamepadInputSource gamepad = new GlobalGamepadInputSource(i);
                gamepad.UpdateState();
                if (!gamepad.IsAvailable)
                {
                    continue;
                }

                this.AddSource(gamepad);
            }
        }
예제 #2
0
        public void AddGlobalDevices()
        {
            int deviceIndex = 0;

            while (true)
            {
                GlobalGamepadInputSource gamepad = new GlobalGamepadInputSource(deviceIndex);
                gamepad.UpdateState();
                if (!gamepad.IsAvailable)
                {
                    break;
                }

                this.AddSource(gamepad);
                deviceIndex++;
            }
        }
예제 #3
0
        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++;
            }
        }