XNA v1.0 has dropped some functionality due to being compatible with the 360. No DirectSound (XACT only), No DirectInput (XInput only which means 360 controllers only) and no fixed function pipeline (though you get BasicEffect to help with a lot of that).
Yes this is annoying to everyone who has a no XInput controller - you can vote for this feature here:
https://connect.microsoft.com/feedback/ViewFeedback.aspx FeedbackID=192779&SiteID=226 (note you must ALREADY be logged into connect before the link will work!)
This thread, http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=692685, has a post by someone who has written some code to enable other controllers which may work for you.
Thanks for the thoughts. I'm glad people are already questioning the non-existance of this obvious need.
I don't know how I can work with something that left out something so important as this. I hope Microsoft fixes this quick because we have decisions on tools to make, and we're hoping by far to use XNA for our titles. Taking out DirectInput for PC versions of the game is a big no no... I'll try that code you provided, but I guess this is why I hate portability with other platforms. Too much necessary stuff get taken out. If they detected the game opened on a non-xbox360 machine, it should be fine to enable DirectInput without causing an exception. C++/DirectX is much uglier than XNA, but if it does the job...
No direct input
try this
using
Microsoft.Xna.Framework.Input;
KeyboardState
state = Keyboard.GetState();
if (state.IsKeyDown(Keys.Space))
System.Diagnostics.Debug.WriteLine("Space has been pressed");
this works for me, u can use this to replace the xbox controller buttons in the starter kit
isn't the whole point of xna to provide cross platform development in a single contained set of libraries And if so, how can they even claim it's cross platform if it doesn't even support their own proprietary (directx) controllers I personally don't care about having to add in directx functionality to get the job done, i'm only developing for pc... but is this cross platform or is it XBOX development... they really need to decide and then provide.
jhered wrote:
isn't the whole point of xna to provide cross platform development in a single contained set of libraries And if so, how can they even claim it's cross platform if it doesn't even support their own proprietary (directx) controllers I personally don't care about having to add in directx functionality to get the job done, i'm only developing for pc... but is this cross platform or is it XBOX development... they really need to decide and then provide.
The fact that the GamePad class does not abstract any game pad is a Good Thing (TM) IMO. The last thing I want to see is diluted support of the 360 pad (on either platform) in order to provide generic gamepad support for the PC only. I would *much* rather see the same exact code on the PC and 360 provide the same gameplay feel using the 360 controller on both platforms. This is the approach the api designers have taken and it's smart IMO.
If you need support for a gamepad on the PC other than the 360 gamepad, then use the Managed DX libs, or write to DirectInput yourself (it's really not that hard). This is exactly what I plan to do, but right now it's not very high on the totem pole as I have a 360 PC controller I'm very happy with. ;-)
I like the approach MS is taking with this framework. This is a great example of where the community can really help each other out. Somebody somewhere will eventually publish a high level gamepad class which encapsulates the 360 gamepad and uses that when detected, and when not it will use DirectInput or MDX on the PC. You can argue that MS should have done this to begin with, and maybe they will in vN. But since this is NOT rocket science to do, and IS implementable by the community, I would much rather see them working on other features like access to networking on the 360. ;-)
- Ryan
Jon Watte wrote:
how can they even claim it's cross platform if it doesn't even support their own proprietary (directx) controllers
They do support their own controllers on PC. You can buy any Xbox 360 compatible wired controller, and plug it into a PC. Microsoft has decided that that's the future for controllers, and that users will have to get one of those, rather than keep around whatever controllers were there before. It's a $29 expense, which is about half of what you'll pay for a new game, so it's not a totally bizarre position to take. The benefit is that all controllers in the XInput world adhere to the same ergonomics, layout, and capabilities, so games can become more consistent.
I understand the logic behind this and in the long run this will be a good thing, all PC users having Xbox 360 controllers would make life easier for everyone.
The problem is that this trend hasn't been set yet. How many commercial PC games have been released with support only for Xbox 360 gamepads
XNA by itself will not set this trend and therefor at present this just puts those using XNA to develop at a disadvantage.