void EventsManager::deinit() { if (!_ready) return; deinitJoysticks(); RequestMan.deinit(); _ready = false; }
void EventsManager::initJoysticks() { deinitJoysticks(); const int joyCount = SDL_NumJoysticks(); if (joyCount <= 0) return; _joysticks.reserve(joyCount); for (int i = 0; i < joyCount; i++) _joysticks.push_back(new Joystick(i)); SDL_JoystickEventState(SDL_ENABLE); }
void EventsManager::reset() { if (!_ready) return; Common::StackLock lock(_eventQueueMutex); // Clear the SDL event queue while (SDL_PollEvent(0)); // Clear our event queue _eventQueue.clear(); deinitJoysticks(); initJoysticks(); }