Jump to content
  • Advertisement
Sign in to follow this  

Controller Input with SDL 2.0 Help

This topic is 2100 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!