Fixed bug 3940 - Add support for EGL_SURFACE_TYPE
authorSam Lantinga <slouken@libsdl.org>
Sat, 04 Nov 2017 09:07:33 -0700
changeset 11677aed6a9ff3c99
parent 11676 591e138c5a04
child 11678 1f10a52295e3
Fixed bug 3940 - Add support for EGL_SURFACE_TYPE

tomwardio

Add support to be able to set EGL_SURFACE_TYPE bits when creating an EGL config. This is usefule when wanting to create pixel buffer surfaces in custom video drivers.
src/video/SDL_egl.c
src/video/SDL_egl_c.h
     1.1 --- a/src/video/SDL_egl.c	Sat Nov 04 09:04:19 2017 -0700
     1.2 +++ b/src/video/SDL_egl.c	Sat Nov 04 09:07:33 2017 -0700
     1.3 @@ -527,6 +527,11 @@
     1.4          _this->egl_data->eglBindAPI(EGL_OPENGL_API);
     1.5      }
     1.6  
     1.7 +    if (_this->egl_data->egl_surfacetype) {
     1.8 +        attribs[i++] = EGL_SURFACE_TYPE;
     1.9 +        attribs[i++] = _this->egl_data->egl_surfacetype;
    1.10 +    }
    1.11 +
    1.12      attribs[i++] = EGL_NONE;
    1.13  
    1.14      if (_this->egl_data->eglChooseConfig(_this->egl_data->egl_display,
     2.1 --- a/src/video/SDL_egl_c.h	Sat Nov 04 09:04:19 2017 -0700
     2.2 +++ b/src/video/SDL_egl_c.h	Sat Nov 04 09:07:33 2017 -0700
     2.3 @@ -35,6 +35,7 @@
     2.4      EGLDisplay egl_display;
     2.5      EGLConfig egl_config;
     2.6      int egl_swapinterval;
     2.7 +    int egl_surfacetype;
     2.8      
     2.9      EGLDisplay(EGLAPIENTRY *eglGetDisplay) (NativeDisplayType display);
    2.10      EGLDisplay(EGLAPIENTRY *eglGetPlatformDisplay) (EGLenum platform,