@Sheado Thanks for your solution for desktop controllers! I hope it gets integrated in a future release, it's a shame that Cocos2d-x doesn't support controllers natively.
I managed to make my controller work with SDL2. It's a bit tricky, however, and it seems a lot of people have trouble with it. The catch is: SDL redefines main(int, char*) as SDL_main, and apparently it expects the SDL initialization to happen there. You just have to edit your main.cpp and create a new main() function that will initialize SDL and run your Cocos app:
int main(int argc, char *argv)
if (SDL_Init(SDL_INIT_JOYSTICK) != 0)
printf(stderr, "\nUnable to initialize SDL: %s\n", SDL_GetError());
And call it from _tWinMain:
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
status = SDL_main(NULL, NULL);
I'm using the win32 solution in Visual Studio 2013. In VS2015 SDL gives lots of warnings and some linker errors, but it seems you only have to recompile the SDL lib. Using the winrt solution is a wholly different thing.