Skip to content

Commit

Permalink
Fixed bug 3940 - Add support for EGL_SURFACE_TYPE
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
slouken committed Nov 4, 2017
1 parent bf3e363 commit 7334a2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/video/SDL_egl.c
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/video/SDL_egl_c.h
Expand Up @@ -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,
Expand Down

0 comments on commit 7334a2a

Please sign in to comment.