src/video/windows/SDL_windowsopengl.c
changeset 11332 e3797888c6f1
parent 10806 36f40b8cc979
child 11346 4d2bf1b340cd
     1.1 --- a/src/video/windows/SDL_windowsopengl.c	Sat Aug 19 11:15:58 2017 -0700
     1.2 +++ b/src/video/windows/SDL_windowsopengl.c	Sat Aug 19 15:02:03 2017 -0400
     1.3 @@ -453,11 +453,16 @@
     1.4          );
     1.5      }
     1.6  
     1.7 -    /* Check for GLX_ARB_context_flush_control */
     1.8 +    /* Check for WGL_ARB_context_flush_control */
     1.9      if (HasExtension("WGL_ARB_context_flush_control", extensions)) {
    1.10          _this->gl_data->HAS_WGL_ARB_context_flush_control = SDL_TRUE;
    1.11      }
    1.12  
    1.13 +    /* Check for WGL_ARB_create_context_robustness */
    1.14 +    if (HasExtension("WGL_ARB_create_context_robustness", extensions)) {
    1.15 +        _this->gl_data->HAS_WGL_ARB_create_context_robustness = SDL_TRUE;
    1.16 +    }
    1.17 +
    1.18      _this->gl_data->wglMakeCurrent(hdc, NULL);
    1.19      _this->gl_data->wglDeleteContext(hglrc);
    1.20      ReleaseDC(hwnd, hdc);
    1.21 @@ -713,8 +718,8 @@
    1.22              SDL_SetError("GL 3.x is not supported");
    1.23              context = temp_context;
    1.24          } else {
    1.25 -        /* max 10 attributes plus terminator */
    1.26 -            int attribs[11] = {
    1.27 +        /* max 12 attributes plus terminator */
    1.28 +            int attribs[13] = {
    1.29                  WGL_CONTEXT_MAJOR_VERSION_ARB, _this->gl_config.major_version,
    1.30                  WGL_CONTEXT_MINOR_VERSION_ARB, _this->gl_config.minor_version,
    1.31                  0
    1.32 @@ -741,6 +746,14 @@
    1.33                                      WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB;
    1.34              }
    1.35  
    1.36 +            /* only set if wgl extension is available */
    1.37 +            if (_this->gl_data->HAS_WGL_ARB_create_context_robustness) {
    1.38 +                attribs[iattr++] = WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB;
    1.39 +                attribs[iattr++] = _this->gl_config.reset_notification ?
    1.40 +                                    WGL_LOSE_CONTEXT_ON_RESET_ARB :
    1.41 +                                    WGL_NO_RESET_NOTIFICATION_ARB;
    1.42 +            }
    1.43 +
    1.44              attribs[iattr++] = 0;
    1.45  
    1.46              /* Create the GL 3.x context */