Merge pull request #2187 from FearlessTobi/port-sdl-things

Port various Citra changes to input_common, including deadzone support
This commit is contained in:
bunnei 2019-03-13 11:46:57 -04:00 committed by GitHub
commit 0a923b4ab3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 785 additions and 691 deletions

View file

@ -135,16 +135,16 @@ bool EmuWindow_SDL2::SupportsRequiredGLExtensions() {
}
EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) {
InputCommon::Init();
SDL_SetMainReady();
// Initialize the window
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 0) {
LOG_CRITICAL(Frontend, "Failed to initialize SDL2! Exiting...");
exit(1);
}
InputCommon::Init();
SDL_SetMainReady();
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
@ -201,11 +201,9 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) {
}
EmuWindow_SDL2::~EmuWindow_SDL2() {
InputCommon::SDL::CloseSDLJoysticks();
InputCommon::Shutdown();
SDL_GL_DeleteContext(gl_context);
SDL_Quit();
InputCommon::Shutdown();
}
void EmuWindow_SDL2::SwapBuffers() {
@ -262,7 +260,6 @@ void EmuWindow_SDL2::PollEvents() {
is_open = false;
break;
default:
InputCommon::SDL::HandleGameControllerEvent(event);
break;
}
}