Jump to content
  • Advertisement
Sign in to follow this  
Dko

SDL Joysticks.

This topic is 4501 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

Im wondering would having a usb controller in windows effect weather SDL finds it? Because my program im coding keeps returning 0 when I poll SDL_NumJoysticks() and I know my controller is pluged in and working. Thanks in advance for any help.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
It sounds like a bug in the API.

Try reporting it to the SDL newsgroup:
http://news.gmane.org/gmane.comp.lib.sdl

Share this post


Link to post
Share on other sites
I doubt it is a bug in SDL. SDL should not care what type of interface your joystick uses (USB, serial, game port, or otherwise). Did you send the flag SDL_INIT_JOYSTICK to SDL_Init()? You said you know the joystick is working. How have you verified that the joystick is working?

Share this post


Link to post
Share on other sites
Well to put it simply to both your questions yes I have. Ive used my controller on tons of other applications and my call to initialze SDL is this.

// Intialize SDL
if (SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_JOYSTICK ) < 0 )

I have no other clue as to why it won't find my controller.

Share this post


Link to post
Share on other sites
I don't remember, but I seem to recall that SDL_NumJoysticks only returns non-zero after you call SDL_JoystickOpen(joyID). Do you call SDL_JoystickOpen?

Share this post


Link to post
Share on other sites
Yea I do. *sigh* tried to swap two function calls that called them yet it still comes up 0.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!