Frontend: Support game controllers

This commit is contained in:
Connor McLaughlin
2019-10-23 21:39:48 +10:00
parent 2d0dd03705
commit e98d109da2
3 changed files with 225 additions and 73 deletions

View File

@ -7,6 +7,7 @@
#include <SDL.h>
#include <array>
#include <deque>
#include <map>
#include <memory>
#include <mutex>
@ -55,6 +56,9 @@ private:
bool CreateAudioStream();
void UpdateAudioVisualSync();
void OpenGameControllers();
void CloseGameControllers();
bool InitializeSystem(const char* filename = nullptr, const char* exp1_filename = nullptr);
void ConnectDevices();
@ -69,8 +73,8 @@ private:
void DoLoadState(u32 index);
void DoSaveState(u32 index);
bool HandleSDLEvent(const SDL_Event* event);
bool HandleSDLKeyEvent(const SDL_Event* event);
void HandleSDLEvent(const SDL_Event* event);
void HandleSDLKeyEvent(const SDL_Event* event);
bool PassEventToImGui(const SDL_Event* event);
void Render();
void RenderDisplay();
@ -99,6 +103,8 @@ private:
std::deque<OSDMessage> m_osd_messages;
std::mutex m_osd_messages_lock;
std::map<int, SDL_GameController*> m_sdl_controllers;
std::shared_ptr<DigitalController> m_controller;
std::shared_ptr<MemoryCard> m_memory_card;