diff -r 4d2bf1b340cd src/video/SDL_egl.c --- a/src/video/SDL_egl.c Thu Aug 24 21:30:53 2017 -0400 +++ b/src/video/SDL_egl.c Thu Aug 24 22:43:43 2017 -0400 @@ -463,18 +463,6 @@ attribs[i++] = _this->gl_config.multisamplesamples; } - if (_this->gl_config.no_error) { -#ifdef GL_KHR_no_error - if (SDL_EGL_HasExtension(_this, SDL_EGL_DISPLAY_EXTENSION, "GL_KHR_no_error")) { - attribs[i++] = EGL_CONTEXT_OPENGL_NO_ERROR_KHR; - attribs[i++] = _this->gl_config.no_error; - } else -#endif - { - return SDL_SetError("EGL implementation does not support no_error contexts"); - } - } - if (_this->gl_config.framebuffer_srgb_capable) { #ifdef EGL_KHR_gl_colorspace if (SDL_EGL_HasExtension(_this, SDL_EGL_DISPLAY_EXTENSION, "EGL_KHR_gl_colorspace")) { @@ -618,6 +606,19 @@ } } + if (_this->gl_config.no_error) { +#ifdef EGL_KHR_create_context_no_error + if (SDL_EGL_HasExtension(_this, SDL_EGL_DISPLAY_EXTENSION, "EGL_KHR_create_context_no_error")) { + attribs[attr++] = EGL_CONTEXT_OPENGL_NO_ERROR_KHR; + attribs[attr++] = _this->gl_config.no_error; + } else +#endif + { + SDL_SetError("EGL implementation does not support no_error contexts"); + return NULL; + } + } + attribs[attr++] = EGL_NONE; /* Bind the API */