src/video/SDL_egl.c
changeset 8966 5771ab3290d6
parent 8964 d9ac759bb62a
child 8971 c30e826412d1
     1.1 --- a/src/video/SDL_egl.c	Sat Jun 28 12:50:17 2014 -0300
     1.2 +++ b/src/video/SDL_egl.c	Sat Jun 28 13:05:16 2014 -0300
     1.3 @@ -416,9 +416,7 @@
     1.4      }
     1.5      
     1.6      /* Bind the API */
     1.7 -#if !__ANDROID__ /* No support for desktop OpenGL on Android */
     1.8      if(_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) {
     1.9 -#endif /* !__ANDROID__ */        
    1.10          _this->egl_data->eglBindAPI(EGL_OPENGL_ES_API);
    1.11          if (_this->gl_config.major_version) {
    1.12              context_attrib_list[1] = _this->gl_config.major_version;
    1.13 @@ -427,11 +425,10 @@
    1.14          egl_context = _this->egl_data->eglCreateContext(_this->egl_data->egl_display,
    1.15                                            _this->egl_data->egl_config,
    1.16                                            share_context, context_attrib_list);
    1.17 -
    1.18 -#if !__ANDROID__
    1.19      }
    1.20      else {
    1.21          _this->egl_data->eglBindAPI(EGL_OPENGL_API);
    1.22 +#ifdef EGL_KHR_create_context        
    1.23          if(SDL_EGL_HasExtension(_this, "EGL_KHR_create_context")) {
    1.24              context_attrib_list[0] = EGL_CONTEXT_MAJOR_VERSION_KHR;
    1.25              context_attrib_list[1] = _this->gl_config.major_version;
    1.26 @@ -452,11 +449,13 @@
    1.27          else {
    1.28              context_attrib_list[0] = EGL_NONE;
    1.29          }
    1.30 +#else /* EGL_KHR_create_context*/
    1.31 +        context_attrib_list[0] = EGL_NONE;
    1.32 +#endif /* EGL_KHR_create_context */
    1.33          egl_context = _this->egl_data->eglCreateContext(_this->egl_data->egl_display,
    1.34                                            _this->egl_data->egl_config,
    1.35                                            share_context, context_attrib_list);
    1.36      }
    1.37 -#endif /* !__ANDROID__ */
    1.38      
    1.39      if (egl_context == EGL_NO_CONTEXT) {
    1.40          SDL_SetError("Could not create EGL context");