Sign in to follow this  
Agent_Q

Is DirectInput still supported?

Recommended Posts

Is DirectInput still supported by Microsoft? It seems lately that everytime I try to program demo code using DirectInput it causes the program to freeze. I'm assuming that the code is correct (because multiple sources set up the code in a similar fashion and it follows MSDN's solution for setting up DirectInput and Devices). I'm running a Vista system - if that means anything for the process. Any knowledge about the matter would be appreciated (and I have come accross a work around if DirectInput is no longer supported). Thanks!

Share this post


Link to post
Share on other sites
Right - the research I've done over the last few days has stated the same. I know with the Vista system, the same code worked a long time ago but I seem to recollect a popup box telling me that DirectInput wasn't safe and asking me if I was sure that I would like to access DirectInput (and maybe I accidentally said no one time and put it into a list that doesn't allow me to access it anymore).

-----

So further testing and bug hunting it is. As I said, I'm following demo code from a couple books...so far, MSDN setup for DirectInput still works as advertised (so the sanity check for setup is good). This leaves me with potentially a polling issue. I'll try to figure out how polling/updating features work tomorrow.

Thanks for the advice!

Share this post


Link to post
Share on other sites
You should really look at using XInput if you don't need the legacy support. It's a really, really easier system and is also the most current. When you XInput (and XAudio) you often find yourself thinking "why isn't DirectX like this"

Share this post


Link to post
Share on other sites
As far as I know XInput is meant for X-Box controllers. It would be useful to know if I ever decide to get a license to post a game to X-Box Live or something along those lines, but as of right now I'm not quite there yet.

Share this post


Link to post
Share on other sites
Yes XInput only supports XBox360 controllers (guitar, steering wheel and others too).
If you really want to support old DInput controllers, you'll have to use DirectInput too and use a wrapper to abstract both APIs. Or just use DirectInput for both controller types.

But XInput is made of pure awesome compared to DirectInput. For example, if you click outside of the game window, say, to debug your game in VS, you'll lose your device, not fun! We should organize a good ol' burnin for DI controllers. Mmmm sweet, sweet toxic fumes! MadCatz...

Share this post


Link to post
Share on other sites
When you say "old DInput controllers", it sounds a bit misleading. Because these old controllers include all those brand new and hi-end Logitech, Genius, Gembird, Saitek gamepads, joysticks, steering wheels etc.


Quote:
For example, if you click outside of the game window, say, to debug your game in VS, you'll lose your device, not fun!


When you specify DISCL_BACKGROUND in SetCooperativeLevel, you won't lose the device when the window loses focus.

Share this post


Link to post
Share on other sites
Although there was a hang up when I had Windows Vista installed, I recompilled my program after updating my OS to Windows 7 and it worked as it was supposed to - no hang ups or anything.

Thanks again for the sanity checks.

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