Add gles2 and EGL error checking.