コード例 #1
0
ファイル: SdlJoystick.cpp プロジェクト: baibaiwei/vrjuggler
bool SdlJoystick::stopAllEffects()
{
#if SDL_VERSION_ATLEAST(1,3,0)
   if (mHaptic) return (SDL_HapticStopAll(mHaptic) == 0);
#endif
   return false;
}
コード例 #2
0
ファイル: FFJoystick.cpp プロジェクト: nickpenaranda/gmdrive
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
ファイル: SDL.cpp プロジェクト: Zombiebest/Dolphin
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);
}