I'm trying to learn a bit of SDL, and have been bouncing between Windows and Mac platforms, but am noticing that an SDL program running on my Macbook doesn't recognize the presence of the Xbox controller I have plugged in. I haven't been able to find anything concrete that says one won't work with the other, which is why I'm here.
For reference, here's the code that I'm using to check for the existence of a joystick via SDL:
bool hasJoystick = false;
hasJoystick = (SDL_NumJoysticks() >= 1) ? true : false;
if(hasJoystick) {
for(int i = 0; i < SDL_NumJoysticks(); i++)
std::cout << "Joystick " << i+1 << " " << SDL_JoystickName(i) << std::endl;
} else {
std::cout << "Yo. No joystick here, kid." << std::endl;
}
I consistently see the "Yo. No joystick here, kid." message in my console. I'm using SDL 1.2 with, and have copied the framework folder to all the appropriate locations. Also, the controller I'm using is 3rd party, but I'm not sure whether that's relevant.