Esempio n. 1
0
void EventsManager::deinit() {
	if (!_ready)
		return;

	deinitJoysticks();

	RequestMan.deinit();

	_ready = false;
}
Esempio n. 2
0
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);
}
Esempio n. 3
0
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();
}