just want to make sure: this should remain 2 even if user wants GLES 3? Similarly, line 33 of this file should remain EGL_OPENGL_ES2_BIT?

If so, can you add some comments to this part of the code to discuss GLES3 selection, and to each of the lines that seem counterintuitive, add a little note that it is valid for GLES3 as well?