Sign in to follow this  
cdxrd

[.net] [xna] Looking for a tutorial on dinput & gamepads...

Recommended Posts

Im stuck at work for the time being, and cant seem find any tutorials on using direct input with c# and xna to access and read a standard gamepad. The xna seems only to work with xbox360 gamepads.. Samples would be awesome! Of course, any help would be welcome! So your aware, Ive never messed with directx before, so call me a newb.. [Edited by - cdxrd on April 9, 2007 8:38:42 PM]

Share this post


Link to post
Share on other sites

You are going to ave to use raw direct input either from the MDX 1.1 system or from the native directx system, as xna only supports xinput compatiple devices.

I would start by looking at the samples in the sdk and moving on from tere, but in the end you are going to have to create your own class and use it in your XNA Application, making sure you poll each update for a new state for the controler.

Share this post


Link to post
Share on other sites
Cool i'll check that out.. I got the directx sdk (april 07) docs folder copied onto a usb flashdrive, but being a newb to directx and xna, Im still kinda lost.. Maybe that link will help a bit. The worst part is it looks like someone on the msdn forums wrote a XNA wrapper for pc gamepad support via direct input,http://www.gamedev.net/community/forums/post.asp?method=reply&topic_id=442960 , and it says :

Quote:

You can pretty much use the class (DirectInputGamepad) as though it were a 360 gamepad, with a few exceptions where PC gamepads differ from 360 ones (for example, PC gamepads support far more buttons, but may have far fewer).


Unfortunately I wasnt able to make it work.. thats kind of a pain only supporting the 360 joystick.. The rest of XNA looks like it could be pretty easy to pick up and use..

Share this post


Link to post
Share on other sites
Still working on this, being a newb to c#, directx and xna isnt helping much.. And I gave the wrong link in the prev post..

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1448362&SiteID=1

Anyways, if someone wants a good tutorial idea, here it is.. heh.. Ive looked at others code and can see how it works, but its just wrapping my mind around everything.. Its so tempting to just go back to allegro and c++.. Im not even sure why I wanted to pick up and learn xna.. heh

Share this post


Link to post
Share on other sites
A simple google search gives me lots of directinput tutorials. Some .net, some c++. And managed directx is close enough to the c++ api that c++ tutorials are still helpfull.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this