Exemple #1
0
int SdlJoystick::getMaxPlayingEffects()
{
#if SDL_VERSION_ATLEAST(1,3,0)
   if (mHaptic) return SDL_HapticNumEffectsPlaying(mHaptic);
#endif
   return 0;
}
Exemple #2
0
JNIEXPORT jint JNICALL Java_at_wisch_joystick_FFJoystick_getPlayNumOfEffectsNative (JNIEnv *env, jclass, jint hapticDeviceIndex){
	int num = SDL_HapticNumEffectsPlaying(ffjoysticks[hapticDeviceIndex]);
	if (num < 0) {
		throwException(env, SDL_GetError());
		return -16;
	}
	return num;
}
Exemple #3
0
static void
IN_Haptic_Effects_Info(void)
{
	show_haptic = true;
	Com_Printf ("Joystic/Mouse haptic:\n");
	Com_Printf (" * %d effects\n", SDL_HapticNumEffects(joystick_haptic));
	Com_Printf (" * %d effects in same time\n", SDL_HapticNumEffectsPlaying(joystick_haptic));
	Com_Printf (" * %d haptic axis\n", SDL_HapticNumAxes(joystick_haptic));
}
Exemple #4
0
static void
IN_Haptic_Effects_Init(void)
{
	last_haptic_efffect_size = SDL_HapticNumEffectsPlaying(joystick_haptic);
	if (last_haptic_efffect_size > HAPTIC_EFFECT_LAST)
		last_haptic_efffect_size = HAPTIC_EFFECT_LAST;
	for (int i=0; i<HAPTIC_EFFECT_LAST; i++)
	{
		last_haptic_efffect[i].effect_type = HAPTIC_EFFECT_UNKNOWN;
		last_haptic_efffect[i].effect_id = -1;
	}
}
Exemple #5
0
/*
 * Displays information about the haptic device.
 */
static void
HapticPrintSupported(SDL_Haptic * haptic)
{
    unsigned int supported;

    supported = SDL_HapticQuery(haptic);
    SDL_Log("   Supported effects [%d effects, %d playing]:\n",
           SDL_HapticNumEffects(haptic), SDL_HapticNumEffectsPlaying(haptic));
    if (supported & SDL_HAPTIC_CONSTANT)
        SDL_Log("      constant\n");
    if (supported & SDL_HAPTIC_SINE)
        SDL_Log("      sine\n");
    /* !!! FIXME: put this back when we have more bits in 2.1 */
    /* if (supported & SDL_HAPTIC_SQUARE)
        SDL_Log("      square\n"); */
    if (supported & SDL_HAPTIC_TRIANGLE)
        SDL_Log("      triangle\n");
    if (supported & SDL_HAPTIC_SAWTOOTHUP)
        SDL_Log("      sawtoothup\n");
    if (supported & SDL_HAPTIC_SAWTOOTHDOWN)
        SDL_Log("      sawtoothdown\n");
    if (supported & SDL_HAPTIC_RAMP)
        SDL_Log("      ramp\n");
    if (supported & SDL_HAPTIC_FRICTION)
        SDL_Log("      friction\n");
    if (supported & SDL_HAPTIC_SPRING)
        SDL_Log("      spring\n");
    if (supported & SDL_HAPTIC_DAMPER)
        SDL_Log("      damper\n");
    if (supported & SDL_HAPTIC_INERTIA)
        SDL_Log("      inertia\n");
    if (supported & SDL_HAPTIC_CUSTOM)
        SDL_Log("      custom\n");
    if (supported & SDL_HAPTIC_LEFTRIGHT)
        SDL_Log("      left/right\n");
    SDL_Log("   Supported capabilities:\n");
    if (supported & SDL_HAPTIC_GAIN)
        SDL_Log("      gain\n");
    if (supported & SDL_HAPTIC_AUTOCENTER)
        SDL_Log("      autocenter\n");
    if (supported & SDL_HAPTIC_STATUS)
        SDL_Log("      status\n");
}
Exemple #6
0
/*
 * Displays information about the haptic device.
 */
static void
HapticPrintSupported(SDL_Haptic * haptic)
{
    unsigned int supported;

    supported = SDL_HapticQuery(haptic);
    printf("   Supported effects [%d effects, %d playing]:\n",
           SDL_HapticNumEffects(haptic), SDL_HapticNumEffectsPlaying(haptic));
    if (supported & SDL_HAPTIC_CONSTANT)
        printf("      constant\n");
    if (supported & SDL_HAPTIC_SINE)
        printf("      sine\n");
    if (supported & SDL_HAPTIC_SQUARE)
        printf("      square\n");
    if (supported & SDL_HAPTIC_TRIANGLE)
        printf("      triangle\n");
    if (supported & SDL_HAPTIC_SAWTOOTHUP)
        printf("      sawtoothup\n");
    if (supported & SDL_HAPTIC_SAWTOOTHDOWN)
        printf("      sawtoothdown\n");
    if (supported & SDL_HAPTIC_RAMP)
        printf("      ramp\n");
    if (supported & SDL_HAPTIC_FRICTION)
        printf("      friction\n");
    if (supported & SDL_HAPTIC_SPRING)
        printf("      spring\n");
    if (supported & SDL_HAPTIC_DAMPER)
        printf("      damper\n");
    if (supported & SDL_HAPTIC_INERTIA)
        printf("      intertia\n");
    if (supported & SDL_HAPTIC_CUSTOM)
        printf("      custom\n");
    printf("   Supported capabilities:\n");
    if (supported & SDL_HAPTIC_GAIN)
        printf("      gain\n");
    if (supported & SDL_HAPTIC_AUTOCENTER)
        printf("      autocenter\n");
    if (supported & SDL_HAPTIC_STATUS)
        printf("      status\n");
}