src/video/uikit/SDL_uikitopengles.m
changeset 10143 14719cd1bde2
parent 10141 fe9cf7c678f4
equal deleted inserted replaced
10142:bc8ac6c0cd98 10143:14719cd1bde2
   138         SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata;
   138         SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata;
   139         CGRect frame = UIKit_ComputeViewFrame(window, data.uiwindow.screen);
   139         CGRect frame = UIKit_ComputeViewFrame(window, data.uiwindow.screen);
   140         EAGLSharegroup *sharegroup = nil;
   140         EAGLSharegroup *sharegroup = nil;
   141         CGFloat scale = 1.0;
   141         CGFloat scale = 1.0;
   142         int samples = 0;
   142         int samples = 0;
       
   143         int major = _this->gl_config.major_version;
       
   144         int minor = _this->gl_config.minor_version;
   143 
   145 
   144         /* The EAGLRenderingAPI enum values currently map 1:1 to major GLES
   146         /* The EAGLRenderingAPI enum values currently map 1:1 to major GLES
   145          * versions. */
   147          * versions. */
   146         EAGLRenderingAPI api = _this->gl_config.major_version;
   148         EAGLRenderingAPI api = major;
       
   149 
       
   150         /* iOS currently doesn't support GLES >3.0. iOS 6 also only supports up
       
   151          * to GLES 2.0. */
       
   152         if (major > 3 || (major == 3 && (minor > 0 || !UIKit_IsSystemVersionAtLeast(7.0)))) {
       
   153             SDL_SetError("OpenGL ES %d.%d context could not be created", major, minor);
       
   154             return NULL;
       
   155         }
   147 
   156 
   148         if (_this->gl_config.multisamplebuffers > 0) {
   157         if (_this->gl_config.multisamplebuffers > 0) {
   149             samples = _this->gl_config.multisamplesamples;
   158             samples = _this->gl_config.multisamplesamples;
   150         }
   159         }
   151 
   160