Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am programming a game with the Gameplay3d Engine. But the Android site has no gamepad support and that is what I need to port my game to Ouya. So I implemented a simple gamepad support and it supports 2 gamepads.

So my problem is that I put the button stats in a float array for every gamepad. But the Gameplay3d engine saves their stats in a unsigned int _buttons variable. It is set with bitwise operations and I have no clue how to translate my array to this.

share|improve this question
    
While you're working on a game, bitwise operations are not specific to game development. So this question is likely off topic here. If you want to know how bitwise operations work, you should try to find a tutorial about it, and if you're unclear on something specifically, ask a question on stackoverflow.com clearly describing what you're having trouble with. –  Byte56 Oct 18 '13 at 16:56
    
ok thx, i will do that. can i ask,here: Is there a good way to implement a gamepad/key mapping in a game, so the player can change the buttons linked to the specific actions ?? how would i start doing that ? –  scorvi Oct 18 '13 at 17:37
    
I'm not sure I understand why you're storing your button stats in a float array? Buttons usually only have on or off states, hence the bits of the _buttons variable you mention. What do you need floats for? –  ktodisco Oct 18 '13 at 21:08
    
the code i used was from an example how to get the gamepad events in ouya. But i edtit it now. I am using std::bitset for the buttons and floats only for the Triggers and Axes. –  scorvi Oct 18 '13 at 22:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.