What other techniques in SDL besides polling the events can i use to handle input? Is SDL_PollEvent really the best option?
What other techniques in SDL besides polling the events can i use to handle input? Is SDL_PollEvent really the best option?
I believe Event Polling is the only method of getting accurate input through SDL. You can of course build a controls interface that will track the states of all your gamepads' game buttons and directional controls, mouse a keyboard input, like I and many others have. This will make designing the game controls of your game much easier as you develop your game.
You can get the state of the keyboard, mouse and joysticks at any time. Use the following routines:
SDL_GetKeyState
SDL_GetMouseState
Joystick functions (scroll down)
Hope this helps.
Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.
Bookmarks