• entries
422
1540
• views
490582

# I freaking love XInput

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):

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]

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. ;)

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

## Create an account

Register a new account