From 7334a2a1b5b545b94152606a31c0c2a1eafbbf19 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 4 Nov 2017 09:07:33 -0700 Subject: [PATCH] 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 | 5 +++++ src/video/SDL_egl_c.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c index 43ba3843e4a7e..3b2305392f9b7 100644 --- a/src/video/SDL_egl.c +++ b/src/video/SDL_egl.c @@ -527,6 +527,11 @@ SDL_EGL_ChooseConfig(_THIS) _this->egl_data->eglBindAPI(EGL_OPENGL_API); } + if (_this->egl_data->egl_surfacetype) { + attribs[i++] = EGL_SURFACE_TYPE; + attribs[i++] = _this->egl_data->egl_surfacetype; + } + attribs[i++] = EGL_NONE; if (_this->egl_data->eglChooseConfig(_this->egl_data->egl_display, diff --git a/src/video/SDL_egl_c.h b/src/video/SDL_egl_c.h index f727e6681252f..37b9602f13645 100644 --- a/src/video/SDL_egl_c.h +++ b/src/video/SDL_egl_c.h @@ -35,6 +35,7 @@ typedef struct SDL_EGL_VideoData EGLDisplay egl_display; EGLConfig egl_config; int egl_swapinterval; + int egl_surfacetype; EGLDisplay(EGLAPIENTRY *eglGetDisplay) (NativeDisplayType display); EGLDisplay(EGLAPIENTRY *eglGetPlatformDisplay) (EGLenum platform,