Beispiel #1
0
int calcNumDevices() {
    if (numDevices>=0)
        return numDevices;
    initAll();
    unsigned int i=0;
    for (; i<MAXJOYSTICKS; i++) {
        int fd=openJoystick(i);
        if (fd<0)
            break;
        closeJoystick(i);
    }
    return numDevices=i;
}
Beispiel #2
0
Joystick::~Joystick() {
    closeJoystick();
}