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

Started by
5 comments, last by gharen2 17 years ago
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]

Squiggly Frog - My little project place on the web. Updated as I see fit. =)

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.
Mykre - BlogVirtual Realm :- XNA News and Resources from Down Under** For those Interested in an Australian XNA User Group Contact me though my site.
Thats why i was hoping for samples. I cant look at the examples being stuck at work.. ah well..

Squiggly Frog - My little project place on the web. Updated as I see fit. =)

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 :)
Rim van Wersch [ MDXInfo ] [ XNAInfo ] [ YouTube ] - Do yourself a favor and bookmark this excellent free online D3D/shader book!
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..

Squiggly Frog - My little project place on the web. Updated as I see fit. =)

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

Squiggly Frog - My little project place on the web. Updated as I see fit. =)

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.

This topic is closed to new replies.

Advertisement