src/video/SDL_video.c
changeset 6393 a773384edf20
parent 6392 fa7eb111f994
child 6418 9c12f2c8057b
equal deleted inserted replaced
6392:fa7eb111f994 6393:a773384edf20
   503     _this->gl_config.minor_version = 0;
   503     _this->gl_config.minor_version = 0;
   504     _this->gl_config.use_egl = 1;
   504     _this->gl_config.use_egl = 1;
   505 #endif
   505 #endif
   506     _this->gl_config.flags = 0;
   506     _this->gl_config.flags = 0;
   507     _this->gl_config.profile_mask = 0;
   507     _this->gl_config.profile_mask = 0;
       
   508     _this->gl_config.share_with_current_context = 0;
   508 
   509 
   509     /* Initialize the video subsystem */
   510     /* Initialize the video subsystem */
   510     if (_this->VideoInit(_this) < 0) {
   511     if (_this->VideoInit(_this) < 0) {
   511         SDL_VideoQuit();
   512         SDL_VideoQuit();
   512         return -1;
   513         return -1;
  2307         break;
  2308         break;
  2308     case SDL_GL_CONTEXT_EGL:
  2309     case SDL_GL_CONTEXT_EGL:
  2309         _this->gl_config.use_egl = value;
  2310         _this->gl_config.use_egl = value;
  2310         break;
  2311         break;
  2311     case SDL_GL_CONTEXT_FLAGS:
  2312     case SDL_GL_CONTEXT_FLAGS:
       
  2313         if( value & ~(SDL_GL_CONTEXT_DEBUG_FLAG |
       
  2314 		      SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG |
       
  2315 		      SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG |
       
  2316 		      SDL_GL_CONTEXT_RESET_ISOLATION_FLAG) ) {
       
  2317 	    SDL_SetError("Unknown OpenGL context flag %d", value);
       
  2318 	    retval = -1;
       
  2319 	    break;
       
  2320 	}
  2312         _this->gl_config.flags = value;
  2321         _this->gl_config.flags = value;
  2313         break;
  2322         break;
  2314     case SDL_GL_CONTEXT_PROFILE_MASK:
  2323     case SDL_GL_CONTEXT_PROFILE_MASK:
       
  2324         if( value != 0 &&
       
  2325 	    value != SDL_GL_CONTEXT_PROFILE_CORE &&
       
  2326 	    value != SDL_GL_CONTEXT_PROFILE_COMPATIBILITY &&
       
  2327 	    value != SDL_GL_CONTEXT_PROFILE_ES ) {
       
  2328 	    SDL_SetError("Unknown OpenGL context profile %d", value);
       
  2329 	    retval = -1;
       
  2330 	    break;
       
  2331 	}
  2315         _this->gl_config.profile_mask = value;
  2332         _this->gl_config.profile_mask = value;
  2316         break;
  2333         break;
       
  2334     case SDL_GL_SHARE_WITH_CURRENT_CONTEXT:
       
  2335         _this->gl_config.share_with_current_context = value;
       
  2336 	break;
  2317     default:
  2337     default:
  2318         SDL_SetError("Unknown OpenGL attribute");
  2338         SDL_SetError("Unknown OpenGL attribute");
  2319         retval = -1;
  2339         retval = -1;
  2320         break;
  2340         break;
  2321     }
  2341     }
  2471             return 0;
  2491             return 0;
  2472         }
  2492         }
  2473     case SDL_GL_CONTEXT_PROFILE_MASK:
  2493     case SDL_GL_CONTEXT_PROFILE_MASK:
  2474         {
  2494         {
  2475             *value = _this->gl_config.profile_mask;
  2495             *value = _this->gl_config.profile_mask;
       
  2496             return 0;
       
  2497         }
       
  2498     case SDL_GL_SHARE_WITH_CURRENT_CONTEXT:
       
  2499         {
       
  2500             *value = _this->gl_config.share_with_current_context;
  2476             return 0;
  2501             return 0;
  2477         }
  2502         }
  2478     default:
  2503     default:
  2479         SDL_SetError("Unknown OpenGL attribute");
  2504         SDL_SetError("Unknown OpenGL attribute");
  2480         return -1;
  2505         return -1;