hrydgard/ppsspp — pull request #6832 by PGGB (2014-09-04 08:44:44+00:00)
Title: Another take on updating to SDL2

Hey I've been trying to update PPSSPP to SDL2.
Looks like the previous effort was mainly missing a way of detecting SDL2 installations on various OS. Luckily the Dolphin project has a CMake module that allows us just that: https://github.com/dolphin-emu/dolphin/blob/master/CMakeTests/FindSDL2.cmake

I've modified it slightly to fix a mismatch with OS X frameworks.

Most of the changes are obviously in the native counterpart: hrydgard/native#236

I've tested this quite a bit on OS X and a little on Linux. No testing was done on Windows and mobile OS, so there will likely be some issues to be fixed there.

Mouse wheels changed in SDL2. They are no longer recognized as buttons. I'm simply sending the KEY_DOWN and KEY_UP events at once right now. Not sure if this needs tweaking.

On OS X fullscreen can be a bit buggy if the built-in fullscreen button/shortcut is used. Not sure how to iron that out yet.

Other than that SDL2 has better support for multi-monitor setups, but for now I kept it in line with the previous implementation where only the first display is taken into consideration.

This PR allows OpenGL contexts up to version 3.2 on Lion and Mountain Lion and up to 4.1 on Mavericks. Sadly enabling does not currently work, because of the deprecation of glGetString(GL_EXTENSIONS) (you have to use glGetStringi for that, since OS X only allows core profile for higher version OpenGL contexts) and some shader compile errors in thin3d.