Can't detect gamepad on OS X

I have some simple code like:

int main() {
SDL_Init(SDL_INIT_VIDEO);
printf(“SDL_INIT_JOYSTICK: %d\n”, SDL_InitSubSystem(SDL_INIT_JOYSTICK));
printf(“SDL_INIT_GAMECONTROLLER: %d\n”,
SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER));

// Create window
SDL_Window* window = SDL_CreateWindow("cube", SDL_WINDOWPOS_CENTERED,

SDL_WINDOWPOS_CENTERED, 800, 600, SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL);

printf("JOY: %d\n", SDL_NumJoysticks());

All SDL_InitSubSystem() calls return 0. SDL_NumJoysticks() also returns 0.
I’m using OS 10.8, SDL2, and Logitech F510 gamepad. Tried both XInput and
DirectInput modes. Gamepad is connected and can be seen in About this Mac
-> More Info -> System Report -> USB section as “Rumble Gamepad F510”.
Looking forward for your help.

Regars, Alexey

Alexey Petruchik wrote:

I have some simple code like:

[snipped code]

All?SDL_InitSubSystem() calls?return 0. SDL_NumJoysticks() also returns 0. I’m using OS 10.8, SDL2, and Logitech F510 gamepad. Tried both XInput and DirectInput modes. Gamepad is connected and can be seen in About this Mac -> More Info -> System Report -> USB section as “Rumble Gamepad F510”. Looking forward for your help.

I don’t see anything obvious staring at me in your code. Have you tried SDL’s testgamecontroller? Also, what’s the GUID reported by your gamepad?

Sorry, that happened to be a really stupid bug made by me. Everything works
fine :)On Wed, Sep 25, 2013 at 12:41 AM, Joseph Carter < tjcarter at spiritsubstance.com> wrote:

**

Alexey Petruchik wrote:

I have some simple code like:

[snipped code]

All SDL_InitSubSystem() calls return 0. SDL_NumJoysticks() also returns 0.
I’m using OS 10.8, SDL2, and Logitech F510 gamepad. Tried both XInput and
DirectInput modes. Gamepad is connected and can be seen in About this Mac
-> More Info -> System Report -> USB section as “Rumble Gamepad F510”.
Looking forward for your help.

I don’t see anything obvious staring at me in your code. Have you tried
SDL’s testgamecontroller? Also, what’s the GUID reported by your gamepad?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org