Bring eglSwapBuffers closer to actual documentation.
Checks now whether ctx was initialized and not lost. Does a glFlush before returning.
And returns success codes from function.
Remove ambiguous error reporting of EGL_NOT_INITIALIZED and add error reporting for EGL_BAD_ACCESS when invalid internal state is encountered.
Remove flush from eglSwapBuffers emulation.