Require OpenGL 3.1 context when opening the SDL window

Since it appears we've settled for OpenGL 3.1 and not 3.2, ask SDL for
that.
Merge pull request #3269 from laarmen/opengl-3.1

Require OpenGL 3.1 context when opening the SDL window