Sync with trunk
Port to SDL2