SDL2: Gamepads stopped working

risingpower@gmx.de risingpower@gmx.de
Tue Oct 3 09:20:30 GMT 2023


Hi,

after a cygwin update, SDL2 does not recognize my gamepads any more.
They definitely worked before:
      libSDL2_2.0_0-2.0.7-1.tar.xz   <- joystick worked fine     (2021-10-09)
      libSDL2_2.0_0-2.28.3-2.tar.xz  <- SDL_NumJoysticks() is 0  (2023-09-30)

Example:
//  $ gcc -o testjoystick testjoystick.cc $(pkg-config --cflags --libs SDL2)
#include <SDL.h>
#include <stdio.h>

int main(int argc, char *argv[]) {
    if (!SDL_WasInit(SDL_INIT_JOYSTICK)) {
        int res = SDL_Init(SDL_INIT_JOYSTICK);
        if (res < 0)
            printf("SDL init joystick failed: %s\n", SDL_GetError());
    }
    int num_joysticks = SDL_NumJoysticks();
    printf("SDL_NumJoysticks()=%d\n", num_joysticks);

    return 0;
}



More information about the Cygwin mailing list