I'm using DirectInput with XNA however for some strange reason my game will not start when I have the following code implemented:
DeviceList gameControllerList = Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly);
That really breaks my game, commenting the line works though leaving it in breaks it. I have absolutely no idea why. I have Microsoft.DirectX.DirectInput
referenced and everything. I even started a whole new project and just entered that line but had no luck in the game starting up.
This is literally my complete code, I just call Input.InitializeController()
from the initialize method in Game1()
.
using System;
using Microsoft.DirectX.DirectInput;
namespace InputTesting{
class Input{
public void InitializeController(){
DeviceList gameControllerList = Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly);
}
}
}
Does anyone know what the deal is with this I am completely stumped.
Thanks!