Esempio n. 1
0
SGbool SG_CALL _sgJoystickInit(void)
{
    size_t i;
    _sg_joyNum = SDL_NumJoysticks();

    _sg_joyJoys = malloc(_sg_joyNum * sizeof(_SGJoystick*));
    for(i = 0; i < _sg_joyNum; i++)
        _sg_joyJoys[i] = _sgJoystickCreate(i);

    return SG_TRUE;
}
Esempio n. 2
0
SGbool SG_EXPORT _sgJoystickInit(void)
{
    _sg_joyCallbacks.button = _sg_cbJoystickButton;
    _sg_joyCallbacks.move = _sg_cbJoystickMove;

    size_t i;
    _sg_joyNum = 0;

    if(psgmCoreJoystickGetNumJoysticks != NULL)
        psgmCoreJoystickGetNumJoysticks(_sg_winHandle, &_sg_joyNum);

    _sg_joyJoys = malloc(_sg_joyNum * sizeof(_SGJoystick*));
    for(i = 0; i < _sg_joyNum; i++)
        _sg_joyJoys[i] = _sgJoystickCreate(i);

    return SG_TRUE;
}