void SDL_StopEventLoop(void) { /* Halt the event thread, if running */ SDL_StopEventThread(); /* Shutdown event handlers */ // SDL_AppActiveQuit(); // SDL_KeyboardQuit(); // SDL_MouseQuit(); SDL_QuitQuit(); /* Clean out EventQ */ SDL_EventQ.head = 0; SDL_EventQ.tail = 0; }
void SDL_StopEventLoop(void) { SDL_StopEventThread(); SDL_AppActiveQuit(); SDL_KeyboardQuit(); SDL_MouseQuit(); SDL_QuitQuit(); SDL_EventQ.head = 0; SDL_EventQ.tail = 0; SDL_EventQ.wmmsg_next = 0; }
void SDL_QuitSubSystem(Uint32 flags) { /* Shut down requested initialized subsystems */ #if !SDL_JOYSTICK_DISABLED if ((flags & SDL_INIT_GAMECONTROLLER)) { /* game controller implies joystick */ flags |= SDL_INIT_JOYSTICK; if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_GAMECONTROLLER)) { SDL_GameControllerQuit(); } SDL_PrivateSubsystemRefCountDecr(SDL_INIT_GAMECONTROLLER); } if ((flags & SDL_INIT_JOYSTICK)) { /* joystick implies events */ flags |= SDL_INIT_EVENTS; if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_JOYSTICK)) { SDL_JoystickQuit(); } SDL_PrivateSubsystemRefCountDecr(SDL_INIT_JOYSTICK); } #endif #if !SDL_HAPTIC_DISABLED if ((flags & SDL_INIT_HAPTIC)) { if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_HAPTIC)) { SDL_HapticQuit(); } SDL_PrivateSubsystemRefCountDecr(SDL_INIT_HAPTIC); } #endif #if !SDL_AUDIO_DISABLED if ((flags & SDL_INIT_AUDIO)) { if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_AUDIO)) { SDL_AudioQuit(); } SDL_PrivateSubsystemRefCountDecr(SDL_INIT_AUDIO); } #endif #if !SDL_VIDEO_DISABLED if ((flags & SDL_INIT_VIDEO)) { /* video implies events */ flags |= SDL_INIT_EVENTS; if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_VIDEO)) { SDL_VideoQuit(); } SDL_PrivateSubsystemRefCountDecr(SDL_INIT_VIDEO); } #endif #if !SDL_TIMERS_DISABLED if ((flags & SDL_INIT_TIMER)) { if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_TIMER)) { SDL_TimerQuit(); } SDL_PrivateSubsystemRefCountDecr(SDL_INIT_TIMER); } #endif #if !SDL_EVENTS_DISABLED if ((flags & SDL_INIT_EVENTS)) { if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_EVENTS)) { SDL_QuitQuit(); SDL_StopEventLoop(); } SDL_PrivateSubsystemRefCountDecr(SDL_INIT_EVENTS); } #endif }