SDL Joysticks.
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.
It sounds like a bug in the API.
Try reporting it to the SDL newsgroup:
http://news.gmane.org/gmane.comp.lib.sdl
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?
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.
// 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?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement