src/video/SDL_video.c
changeset 7723 aea98cc3e696
parent 7721 bdf8c2c84e14
child 7742 84e32c3d415c
equal deleted inserted replaced
7722:ea5565d856a8 7723:aea98cc3e696
   475     _this->gl_config.stereo = 0;
   475     _this->gl_config.stereo = 0;
   476     _this->gl_config.multisamplebuffers = 0;
   476     _this->gl_config.multisamplebuffers = 0;
   477     _this->gl_config.multisamplesamples = 0;
   477     _this->gl_config.multisamplesamples = 0;
   478     _this->gl_config.retained_backing = 1;
   478     _this->gl_config.retained_backing = 1;
   479     _this->gl_config.accelerated = -1;  /* accelerated or not, both are fine */
   479     _this->gl_config.accelerated = -1;  /* accelerated or not, both are fine */
       
   480     _this->gl_config.profile_mask = 0;
   480 #if SDL_VIDEO_OPENGL
   481 #if SDL_VIDEO_OPENGL
   481     _this->gl_config.major_version = 2;
   482     _this->gl_config.major_version = 2;
   482     _this->gl_config.minor_version = 1;
   483     _this->gl_config.minor_version = 1;
   483     _this->gl_config.use_egl = 0;
       
   484 #elif SDL_VIDEO_OPENGL_ES
   484 #elif SDL_VIDEO_OPENGL_ES
   485     _this->gl_config.major_version = 1;
   485     _this->gl_config.major_version = 1;
   486     _this->gl_config.minor_version = 1;
   486     _this->gl_config.minor_version = 1;
   487 #if SDL_VIDEO_OPENGL_EGL    
   487     _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES;
   488     _this->gl_config.use_egl = 1;
       
   489 #endif    
       
   490 #elif SDL_VIDEO_OPENGL_ES2
   488 #elif SDL_VIDEO_OPENGL_ES2
   491     _this->gl_config.major_version = 2;
   489     _this->gl_config.major_version = 2;
   492     _this->gl_config.minor_version = 0;
   490     _this->gl_config.minor_version = 0;
   493 #if SDL_VIDEO_OPENGL_EGL    
   491     _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES;   
   494     _this->gl_config.use_egl = 1;
       
   495 #endif
       
   496     
       
   497 #endif
   492 #endif
   498     _this->gl_config.flags = 0;
   493     _this->gl_config.flags = 0;
   499     _this->gl_config.profile_mask = 0;
   494     
   500     _this->gl_config.share_with_current_context = 0;
   495     _this->gl_config.share_with_current_context = 0;
   501 
   496 
   502     _this->current_glwin_tls = SDL_TLSCreate();
   497     _this->current_glwin_tls = SDL_TLSCreate();
   503     _this->current_glctx_tls = SDL_TLSCreate();
   498     _this->current_glctx_tls = SDL_TLSCreate();
   504 
   499 
  2514         break;
  2509         break;
  2515     case SDL_GL_CONTEXT_MINOR_VERSION:
  2510     case SDL_GL_CONTEXT_MINOR_VERSION:
  2516         _this->gl_config.minor_version = value;
  2511         _this->gl_config.minor_version = value;
  2517         break;
  2512         break;
  2518     case SDL_GL_CONTEXT_EGL:
  2513     case SDL_GL_CONTEXT_EGL:
  2519         _this->gl_config.use_egl = value;
  2514         /* FIXME: SDL_GL_CONTEXT_EGL to be deprecated in SDL 2.1 */
       
  2515         if (value != 0) {
       
  2516             SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
       
  2517         } else {
       
  2518             SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, 0);
       
  2519         };
  2520         break;
  2520         break;
  2521     case SDL_GL_CONTEXT_FLAGS:
  2521     case SDL_GL_CONTEXT_FLAGS:
  2522         if( value & ~(SDL_GL_CONTEXT_DEBUG_FLAG |
  2522         if( value & ~(SDL_GL_CONTEXT_DEBUG_FLAG |
  2523               SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG |
  2523               SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG |
  2524               SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG |
  2524               SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG |
  2684         {
  2684         {
  2685             *value = _this->gl_config.minor_version;
  2685             *value = _this->gl_config.minor_version;
  2686             return 0;
  2686             return 0;
  2687         }
  2687         }
  2688     case SDL_GL_CONTEXT_EGL:
  2688     case SDL_GL_CONTEXT_EGL:
       
  2689         /* FIXME: SDL_GL_CONTEXT_EGL to be deprecated in SDL 2.1 */
  2689         {
  2690         {
  2690             *value = _this->gl_config.use_egl;
  2691             if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) {
       
  2692                 *value = 1;
       
  2693             }
       
  2694             else {
       
  2695                 *value = 0;
       
  2696             }
  2691             return 0;
  2697             return 0;
  2692         }
  2698         }
  2693     case SDL_GL_CONTEXT_FLAGS:
  2699     case SDL_GL_CONTEXT_FLAGS:
  2694         {
  2700         {
  2695             *value = _this->gl_config.flags;
  2701             *value = _this->gl_config.flags;