Jump to content
  • Advertisement
Sign in to follow this  
cdxrd

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

This topic is 4144 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement

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
Thats why i was hoping for samples. I cant look at the examples being stuck at work.. ah well..

Share this post


Link to post
Share on other sites
Searching around a bit turned up this Coding4Fun article which seems to give a sketchy introduction to DirectInput at least. Unfortunately that page keeps crashing my browser, so I don't know if it's any good.

Good luck at any rate :)

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!