src/video/SDL_video.c
changeset 6393 a773384edf20
parent 6392 fa7eb111f994
child 6418 9c12f2c8057b
     1.1 --- a/src/video/SDL_video.c	Sat Aug 11 10:15:59 2012 -0700
     1.2 +++ b/src/video/SDL_video.c	Sun Aug 12 11:16:24 2012 -0700
     1.3 @@ -505,6 +505,7 @@
     1.4  #endif
     1.5      _this->gl_config.flags = 0;
     1.6      _this->gl_config.profile_mask = 0;
     1.7 +    _this->gl_config.share_with_current_context = 0;
     1.8  
     1.9      /* Initialize the video subsystem */
    1.10      if (_this->VideoInit(_this) < 0) {
    1.11 @@ -2309,11 +2310,30 @@
    1.12          _this->gl_config.use_egl = value;
    1.13          break;
    1.14      case SDL_GL_CONTEXT_FLAGS:
    1.15 +        if( value & ~(SDL_GL_CONTEXT_DEBUG_FLAG |
    1.16 +		      SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG |
    1.17 +		      SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG |
    1.18 +		      SDL_GL_CONTEXT_RESET_ISOLATION_FLAG) ) {
    1.19 +	    SDL_SetError("Unknown OpenGL context flag %d", value);
    1.20 +	    retval = -1;
    1.21 +	    break;
    1.22 +	}
    1.23          _this->gl_config.flags = value;
    1.24          break;
    1.25      case SDL_GL_CONTEXT_PROFILE_MASK:
    1.26 +        if( value != 0 &&
    1.27 +	    value != SDL_GL_CONTEXT_PROFILE_CORE &&
    1.28 +	    value != SDL_GL_CONTEXT_PROFILE_COMPATIBILITY &&
    1.29 +	    value != SDL_GL_CONTEXT_PROFILE_ES ) {
    1.30 +	    SDL_SetError("Unknown OpenGL context profile %d", value);
    1.31 +	    retval = -1;
    1.32 +	    break;
    1.33 +	}
    1.34          _this->gl_config.profile_mask = value;
    1.35          break;
    1.36 +    case SDL_GL_SHARE_WITH_CURRENT_CONTEXT:
    1.37 +        _this->gl_config.share_with_current_context = value;
    1.38 +	break;
    1.39      default:
    1.40          SDL_SetError("Unknown OpenGL attribute");
    1.41          retval = -1;
    1.42 @@ -2475,6 +2495,11 @@
    1.43              *value = _this->gl_config.profile_mask;
    1.44              return 0;
    1.45          }
    1.46 +    case SDL_GL_SHARE_WITH_CURRENT_CONTEXT:
    1.47 +        {
    1.48 +            *value = _this->gl_config.share_with_current_context;
    1.49 +            return 0;
    1.50 +        }
    1.51      default:
    1.52          SDL_SetError("Unknown OpenGL attribute");
    1.53          return -1;