src/video/SDL_egl.c
changeset 11347 7f254d0b7842
parent 11346 4d2bf1b340cd
child 11363 2d3d35b2c95a
     1.1 --- a/src/video/SDL_egl.c	Thu Aug 24 21:30:53 2017 -0400
     1.2 +++ b/src/video/SDL_egl.c	Thu Aug 24 22:57:42 2017 -0400
     1.3 @@ -463,18 +463,6 @@
     1.4          attribs[i++] = _this->gl_config.multisamplesamples;
     1.5      }
     1.6  
     1.7 -    if (_this->gl_config.no_error) {
     1.8 -#ifdef GL_KHR_no_error
     1.9 -        if (SDL_EGL_HasExtension(_this, SDL_EGL_DISPLAY_EXTENSION, "GL_KHR_no_error")) {
    1.10 -            attribs[i++] = EGL_CONTEXT_OPENGL_NO_ERROR_KHR;
    1.11 -            attribs[i++] = _this->gl_config.no_error;
    1.12 -        } else
    1.13 -#endif
    1.14 -        {
    1.15 -            return SDL_SetError("EGL implementation does not support no_error contexts");
    1.16 -        }
    1.17 -    }
    1.18 -
    1.19      if (_this->gl_config.framebuffer_srgb_capable) {
    1.20  #ifdef EGL_KHR_gl_colorspace
    1.21          if (SDL_EGL_HasExtension(_this, SDL_EGL_DISPLAY_EXTENSION, "EGL_KHR_gl_colorspace")) {
    1.22 @@ -618,6 +606,19 @@
    1.23          }
    1.24      }
    1.25  
    1.26 +    if (_this->gl_config.no_error) {
    1.27 +#ifdef EGL_KHR_create_context_no_error
    1.28 +        if (SDL_EGL_HasExtension(_this, SDL_EGL_DISPLAY_EXTENSION, "EGL_KHR_create_context_no_error")) {
    1.29 +            attribs[attr++] = EGL_CONTEXT_OPENGL_NO_ERROR_KHR;
    1.30 +            attribs[attr++] = _this->gl_config.no_error;
    1.31 +        } else
    1.32 +#endif
    1.33 +        {
    1.34 +            SDL_SetError("EGL implementation does not support no_error contexts");
    1.35 +            return NULL;
    1.36 +        }
    1.37 +    }
    1.38 +
    1.39      attribs[attr++] = EGL_NONE;
    1.40  
    1.41      /* Bind the API */