SDL Joysticks.

Started by
6 comments, last by pjcast 18 years ago
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.
Advertisement
anyone?
It sounds like a bug in the API.

Try reporting it to the SDL newsgroup:
http://news.gmane.org/gmane.comp.lib.sdl
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?
"When you die, if you get a choice between going to regular heaven or pie heaven, choose pie heaven. It might be a trick, but if it's not, mmmmmmm, boy."
How to Ask Questions the Smart Way.
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.
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?
"When you die, if you get a choice between going to regular heaven or pie heaven, choose pie heaven. It might be a trick, but if it's not, mmmmmmm, boy."
How to Ask Questions the Smart Way.
Yea I do. *sigh* tried to swap two function calls that called them yet it still comes up 0.
Perhaps, as an option, you could try using my Input Lib (OIS), check my sig for details.

This topic is closed to new replies.

Advertisement