Jump to content
  • entries
    422
  • comments
    1540
  • views
    490582

I freaking love XInput

Sign in to follow this  
jollyjeffers

91 views

Because I'm supposed to be revising for exams at the moment I decided to carry on with the game I mentioned yesterday.

I've decided I love XInput. If only all API's were this simple:

// Put this in the usual place:
#include

// Put the following anywhere you want to check input:
XINPUT_STATE currentState;
if( ERROR_SUCCESS == XInputGetState( 0, ¤tState ) )
{
// Process the input here, just a simple case
// of checking flagged bits against constants.
}
else
{
// The device isn't connected. Use WM's or DInput instead.
}



In so little time it seems wrong, I have a player mesh zipping around in my little game world (it's the red "thing" at the back of the grid):

Sign in to follow this  


3 Comments


Recommended Comments

Quote:
Because I'm supposed to be revising for exams at the moment I decided to carry on with the game I mentioned yesterday.


Haha!! If you had done otherwise, I would have been forced to call your sanity into question. [grin]

Share this comment


Link to comment
Quote:
I've decided I love XInput. If only all API's were this simple


Aye, it does seem a little odd. Very not-like Microsoft to have such a straight-forward API. ;)

Share this comment


Link to comment
Quote:
I would have been forced to call your sanity into question
I accepted a role as a moderator, is that proof enough that I'm (in)sane? [lol]

Quote:
Very not-like Microsoft to have such a straight-forward API.
Agreed. But I won't be complaining. What really threw me was the lack of any initialization/termination code. That's pretty much a given across all of DirectX as far back as I can remember. I'm a bit lost if I don't have to do that [oh]

Jack

Share this comment


Link to comment

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
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!