Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Controller Input with SDL 2.0 Help

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
No replies to this topic

#1 c_fried_rice   Members   

163
Like
0Likes
Like

Posted 15 October 2013 - 03:49 AM

Hey guys!

 

So I'm trying to write an input manager for a game engine I'm writing for a senior project in SDL. However, I'm having some issues. Namely detecting button presses in the current frame. I'm using the SDL Game Controller functionality to attempt to do it (as opposed to the Joystick functionality).

 

So. Anyone have any suggestions on how to do this? Basically, I wanted to model it similar to XNA's Gamepad and Gamepadstate classes...  (see here: http://msdn.microsoft.com/en-us/library/bb313875.aspx)but I'm not really sure about how to do it, and the lack of documentation (to my knowledge) of SDL 2's Game Controller functionality has made this rather hard.

 

Later today I can post some code I have of just getting button presses that are basically read multiple times a frame (as in I press and release and if it's meant to print something to cout it will do it like 10 times just as an example), but I have a feeling it won't be much use for doing it the correct way.

 

I'm not looking for straight-up code, but more for a discussion on how to go about doing this, possibly with input from somebody who's got some experience using the Game Controller functionality of SDL 2.

 

Thanks a ton!

 






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.