EGL Threading Issues

I just wanted to notify anyone currently having issues with the EGL OpenGL
api that I found a bug https://bugzilla.libsdl.org/show_bug.cgi?id=2937.

If the context is created on one thread and then made current on another
SDL will not call eglBindApi for that thread and the egl api on that thread
will be whatever the default is. It could be undefined or could be GLES for
example.

You can still render to the context using gl functions but it will causes
an issue later in operations such as eglSwapBuffers which on mesa will
check to see if the context is current based on the currently bound api and
so will report an EGL_BAD_SURFACE.

In summary eglBindApi needs to be called per thread. It should also be
called if the context is created with a different api type such as mixing
GLES and OpenGL contexts.

Also there will be no errors and the window will just remain
empty/transparent as SDL does not provide any error checking for
SDL_GL_SwapWindow.
Another issue I reported https://bugzilla.libsdl.org/show_bug.cgi?id=2936.

If I get time I will try to make patches for these but if someone else may
get round to it first.