mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
Context sharing for EGL
This commit is contained in:
parent
2159de66c4
commit
4a8c296712
@ -340,7 +340,7 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface)
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
EGLContext egl_context;
|
||||
EGLContext egl_context, share_context = EGL_NO_CONTEXT;
|
||||
|
||||
if (!_this->egl_data) {
|
||||
/* The EGL library wasn't loaded, SDL_GetError() should have info */
|
||||
@ -351,10 +351,14 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface)
|
||||
context_attrib_list[1] = _this->gl_config.major_version;
|
||||
}
|
||||
|
||||
if (_this->gl_config.share_with_current_context) {
|
||||
share_context = (EGLContext)SDL_GL_GetCurrentContext();
|
||||
}
|
||||
|
||||
egl_context =
|
||||
_this->egl_data->eglCreateContext(_this->egl_data->egl_display,
|
||||
_this->egl_data->egl_config,
|
||||
EGL_NO_CONTEXT, context_attrib_list);
|
||||
share_context, context_attrib_list);
|
||||
|
||||
if (egl_context == EGL_NO_CONTEXT) {
|
||||
SDL_SetError("Could not create EGL context");
|
||||
|
Loading…
Reference in New Issue
Block a user