DirectInput

Started by
10 comments, last by Evil Steve 16 years ago
Hey, I was thinking about this. A friend and I want to make a small mech simulator, almost like Steel Battalion + Gundam (get the idea?). We want the control to be a joystick with rudders. I was considering XInput, but we're not worried about the Xbox360 controller, rather, joysticks as I said earlier. For compatibility, we want to use DirectInput, since the wikipedia article on XInput says that it has some limitations. Basically, I need to find some DirectInput joystick tutorials, and if somebody goes against it, can you recommend some alternative free input libraries? Thanks in advance.
Advertisement
You probably don't want DirectInput. What sort of joysticks do you want to support? If it's the "classic" joystick, the multimedia API has functions that are more than adequate (Although I can't recall any function names offhand, so I can't check what it can and can't do). If you need force feedback, or a billion buttons (Again, the multimedia API might handle more than 4 or 5 buttons, I can't remember), then DirectInput is a reasonable option.
Actually yeah, I do need force feedback.I was thinking about supporting the Logitech Extreme 3D Pro. Here is a picture of it for those who are too lazy to Google it:

Image Hosted by ImageShack.us


Please help me out guys. Thanks in advance.
Check out the directx SDK there is a directinput joystick example included.
Quote:Original post by Evil Steve
You probably don't want DirectInput.


can you elaborate on this? Why not use direct input to joystick polling?

Well... DirectInput is fairly evil under the hood. Some bizarre hooking stuff...
I get the feeling that EvilSteve is going to link to that thing in his journal.

But I can't be bothered to find it.

Basically DirectInput is slow and I would expect this multimedia API thingy will probably be quicker and if its not COM, understandable!
Check for RAWINPUT, and its related functions on MSDN. Might be of some help. Similar to DI.
Quote:Original post by ganbree
Well... DirectInput is fairly evil under the hood. Some bizarre hooking stuff...
I get the feeling that EvilSteve is going to link to that thing in his journal.

But I can't be bothered to find it.

Basically DirectInput is slow and I would expect this multimedia API thingy will probably be quicker and if its not COM, understandable!
It's in my bookmarks [smile]

Although it's less of a concern for joystick input, but I believe the multimedia API has support for joysticks.
DirectInput just spawns a second thread to handle messages for you, which has a slight overhead, and it's a pain to set up.
Although I should point out that I've not written any code to support joysticks, so I'm not really qualified to say what's good and what's not [smile]
thanks both :)
reading throught it... you are reducing your target audience with this method.
Thought of pointing this, as may be of concern for some users.

This topic is closed to new replies.

Advertisement