示例#1
0
bool SdlJoystick::stopAllEffects()
{
#if SDL_VERSION_ATLEAST(1,3,0)
   if (mHaptic) return (SDL_HapticStopAll(mHaptic) == 0);
#endif
   return false;
}
示例#2
0
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;
}
示例#3
0
文件: SDL.cpp 项目: BhaaLseN/dolphin
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);
}
示例#4
0
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);
}
示例#5
0
文件: SDL.cpp 项目: Annovae/dolphin
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);
}