src/video/SDL_egl.c
changeset 8976 1a5d959d7b32
parent 8971 c30e826412d1
child 9162 69856cdc9da6
     1.1 --- a/src/video/SDL_egl.c	Sun Jul 06 20:41:39 2014 -0700
     1.2 +++ b/src/video/SDL_egl.c	Mon Jul 07 10:26:28 2014 -0700
     1.3 @@ -69,6 +69,7 @@
     1.4  }
     1.5      
     1.6  /* EGL implementation of SDL OpenGL ES support */
     1.7 +#ifdef EGL_KHR_create_context        
     1.8  static int SDL_EGL_HasExtension(_THIS, const char *ext)
     1.9  {
    1.10      int i;
    1.11 @@ -100,6 +101,7 @@
    1.12  
    1.13      return 0;
    1.14  }
    1.15 +#endif /* EGL_KHR_create_context */
    1.16  
    1.17  void *
    1.18  SDL_EGL_GetProcAddress(_THIS, const char *proc)
    1.19 @@ -552,21 +554,22 @@
    1.20  EGLSurface *
    1.21  SDL_EGL_CreateSurface(_THIS, NativeWindowType nw) 
    1.22  {
    1.23 -    EGLint format;
    1.24 -    
    1.25      if (SDL_EGL_ChooseConfig(_this) != 0) {
    1.26          return EGL_NO_SURFACE;
    1.27      }
    1.28      
    1.29  #if __ANDROID__
    1.30 -    /* Android docs recommend doing this!
    1.31 -     * Ref: http://developer.android.com/reference/android/app/NativeActivity.html 
    1.32 -     */
    1.33 -    _this->egl_data->eglGetConfigAttrib(_this->egl_data->egl_display,
    1.34 -                                        _this->egl_data->egl_config, 
    1.35 -                                        EGL_NATIVE_VISUAL_ID, &format);
    1.36 +    {
    1.37 +        /* Android docs recommend doing this!
    1.38 +         * Ref: http://developer.android.com/reference/android/app/NativeActivity.html 
    1.39 +         */
    1.40 +        EGLint format;
    1.41 +        _this->egl_data->eglGetConfigAttrib(_this->egl_data->egl_display,
    1.42 +                                            _this->egl_data->egl_config, 
    1.43 +                                            EGL_NATIVE_VISUAL_ID, &format);
    1.44  
    1.45 -    ANativeWindow_setBuffersGeometry(nw, 0, 0, format);
    1.46 +        ANativeWindow_setBuffersGeometry(nw, 0, 0, format);
    1.47 +    }
    1.48  #endif    
    1.49      
    1.50      return _this->egl_data->eglCreateWindowSurface(