Results 1 to 3 of 3

Thread: SDL Polling vs ??

  1. #1

    SDL Polling vs ??

    What other techniques in SDL besides polling the events can i use to handle input? Is SDL_PollEvent really the best option?

  2. #2
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    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.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •