bool SdlJoystick::stopAllEffects() { #if SDL_VERSION_ATLEAST(1,3,0) if (mHaptic) return (SDL_HapticStopAll(mHaptic) == 0); #endif return false; }
JNIEXPORT jint JNICALL Java_at_wisch_joystick_FFJoystick_stopAllNative (JNIEnv *env, jclass, jint hapticDeviceIndex){ int num = SDL_HapticStopAll(ffjoysticks[hapticDeviceIndex]); if (num < 0) { throwException(env, SDL_GetError()); return -27; } return 0; }
Joystick::~Joystick() { #ifdef USE_SDL_HAPTIC if (m_haptic) { // stop/destroy all effects SDL_HapticStopAll(m_haptic); // close haptic first SDL_HapticClose(m_haptic); } #endif // close joystick SDL_JoystickClose(m_joystick); }
Joystick::~Joystick() { #ifdef USE_SDL_HAPTIC if (m_haptic) { // stop/destroy all effects SDL_HapticStopAll(m_haptic); std::list<EffectIDState>::iterator i = m_state_out.begin(), e = m_state_out.end(); for ( ; i != e; ++i) if (i->id != -1) SDL_HapticDestroyEffect(m_haptic, i->id); // close haptic first SDL_HapticClose(m_haptic); } #endif // close joystick SDL_JoystickClose(m_joystick); }
Joystick::~Joystick() { #ifdef USE_SDL_HAPTIC if (m_haptic) { // stop/destroy all effects SDL_HapticStopAll(m_haptic); for (auto &i : m_state_out) { if (i.id != -1) { SDL_HapticDestroyEffect(m_haptic, i.id); } } // close haptic first SDL_HapticClose(m_haptic); } #endif // close joystick SDL_JoystickClose(m_joystick); }