Sign in to follow this  
Toji

joyGetPosEx

Recommended Posts

I'll make this one quick: I've been implementing various input libraries in my code recently and am stuck with a small dilemma. I currently have implemented: Mouse, through WM_INPUT Keyboard, through the standard windows messages XBox 360 pad, through XInput (which I love, BTW) Now I'm working on non-360 game controllers, and I'm at an impasse as to what method I want to use. For my part, I really want to expose the controllers much in the same way I do the XInput controllers. Basically:
XInputState state = XInput.GetState(0); // Get the state for player 1
Looking at the Win32 Joystick APIs, it seems that joyGetPosEx does this job nicely! After a bit of fiddling, I got that up and running no problem, but now I have something nagging at me: Is Direct Input the better choice? Frankly, I despise the DI8 API. It does offer force feedback, though (which it seems simply isn't available any other way), and it's pretty clearly defined how you can tell a 360 controller apart from your standard DI device. I'm not sure how you would accomplish that with the Win32 APIs. So the question is: does anyone have a convincing argument for one API over the other?

Share this post


Link to post
Share on other sites
Win32 wont provide you with all the bells and whistles. If you need more than what Win32 provides (which is very little), then you will have to go to DirectX, but it's no big deal really. You will have to enumerate your devices, create an interface for each of them, poll, setup some vibration effects, and Bob's your uncle. I dont like the DirectX8 either, but once you're used to it, it's no biggy. I'd write a wrapper around it to make life easier.

I'm also not a fan of using messages for controllers. Really, it should just be a day or two job.

Share this post


Link to post
Share on other sites
I should point out that I already have a working implementation for both (minus the few "bells and whistles"), so it's not a matter of what's easier to implement. But I don't see any sense in having two disparate methods for reaching the same data, so I'm going to drop one of them. I'm just putting out feelers as to which is preferred (if any).

Share this post


Link to post
Share on other sites
I'd stick with DirectX. Win32 is too limited, DirectInput is made for handling game controllers, well supported, very extensive, ect... It's worth the extra hassle.

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