Gamepad support programing?

Started by
10 comments, last by Kylotan 17 years ago
hi all ! Im trying to add suport for gamepads in my engine, now I need to know wich is the best way to aproach, directinput perhaps? Also if you know any good tuts please post the link. Thanks a lot in advance
Advertisement
Moved to For Beginners.
What language? What platform? DirectInput is a good bet, but it's Microsoft platforms only...
DirectInput if you're working just with windows, SDL if you're crossplatform.

(in fact the windows build of SDL is just a thin wrapper around directinput).

You can use directinput from c++ or the .net languages. You should be able to use SDL with pretty much any language.
By far the easiest way is XInput, but that limits you to Xbox 360 controllers only. (I don't see that as a problem as I code mainly for myself). Otherwise, on Windows, DirectInput is your best bet.
I need something that will let me code different type of controllers or "profiles" since other people might not have my type of controller.

So I need some tuts on how to program gamepad support for that kind of situations...

And yes it will windows based only.
You won't need to worry too much about specific kinds of controllers.

DirectInput abstracts that all away, you just work with a simple device object that tells you how many buttons, sticks, dpads, etc it has and let's you obtain their states.

The important thing is not to force the user to use one particular control setup. If you give them the ability to remap controls (changing what a particular button does, for example), then virtually any gamepad will be usable in your game.
well I was trying the Directx examples but it seems that since my gamepad is wireless with a usb connection for the wireless port it cant be detected. Any help on this?

Thanks!
Lots of possibilities, especially considering you didn't tell us what kind of gamepad you have. There's 10000 different ones out there.

Does the gamepad work for you with other games?

Is it directx compatible?

Do you need to install a special driver? (you have to in order to use the xbox 360 gamepads in windows).

Does the gamepad require batteries? Are they charged?
The gamepad is a Saitek P2900 Wireless.

The page with info is here: http://www.saitekusa.com/usa/prod/p2900.htm

It works with other games.

I suppose its directx compatible.

about drivers... cant remember I suppose thats yes you have to install the vendors drivers.

ANd yes... its on and with batteries

This topic is closed to new replies.

Advertisement