src/video/windows/SDL_windowsopengl.c
changeset 11347 7f254d0b7842
parent 11346 4d2bf1b340cd
child 11351 9e5dc03870e1
     1.1 --- a/src/video/windows/SDL_windowsopengl.c	Thu Aug 24 21:30:53 2017 -0400
     1.2 +++ b/src/video/windows/SDL_windowsopengl.c	Thu Aug 24 22:57:42 2017 -0400
     1.3 @@ -468,6 +468,11 @@
     1.4          _this->gl_data->HAS_WGL_ARB_create_context_robustness = SDL_TRUE;
     1.5      }
     1.6  
     1.7 +    /* Check for WGL_ARB_create_context_no_error */
     1.8 +    if (HasExtension("WGL_ARB_create_context_no_error", extensions)) {
     1.9 +        _this->gl_data->HAS_WGL_ARB_create_context_no_error = SDL_TRUE;
    1.10 +    }
    1.11 +
    1.12      _this->gl_data->wglMakeCurrent(hdc, NULL);
    1.13      _this->gl_data->wglDeleteContext(hglrc);
    1.14      ReleaseDC(hwnd, hdc);
    1.15 @@ -598,11 +603,6 @@
    1.16          *iAttr++ = _this->gl_config.framebuffer_srgb_capable;
    1.17      }
    1.18  
    1.19 -    if (_this->gl_config.no_error) {
    1.20 -        *iAttr++ = WGL_CONTEXT_OPENGL_NO_ERROR_ARB;
    1.21 -        *iAttr++ = _this->gl_config.no_error;
    1.22 -    }
    1.23 -
    1.24      /* We always choose either FULL or NO accel on Windows, because of flaky
    1.25         drivers. If the app didn't specify, we use FULL, because that's
    1.26         probably what they wanted (and if you didn't care and got FULL, that's
    1.27 @@ -728,8 +728,8 @@
    1.28              SDL_SetError("GL 3.x is not supported");
    1.29              context = temp_context;
    1.30          } else {
    1.31 -        /* max 12 attributes plus terminator */
    1.32 -            int attribs[13] = {
    1.33 +        /* max 14 attributes plus terminator */
    1.34 +            int attribs[15] = {
    1.35                  WGL_CONTEXT_MAJOR_VERSION_ARB, _this->gl_config.major_version,
    1.36                  WGL_CONTEXT_MINOR_VERSION_ARB, _this->gl_config.minor_version,
    1.37                  0
    1.38 @@ -764,6 +764,12 @@
    1.39                                      WGL_NO_RESET_NOTIFICATION_ARB;
    1.40              }
    1.41  
    1.42 +            /* only set if wgl extension is available */
    1.43 +            if (_this->gl_data->HAS_WGL_ARB_create_context_no_error) {
    1.44 +                attribs[iattr++] = WGL_CONTEXT_OPENGL_NO_ERROR_ARB;
    1.45 +                attribs[iattr++] = _this->gl_config.no_error;
    1.46 +            }
    1.47 +
    1.48              attribs[iattr++] = 0;
    1.49  
    1.50              /* Create the GL 3.x context */