mirror of https://github.com/encounter/SDL.git
egl: explicitly call eglBindAPI during SDL_GL_MakeCurrent.
The EGL API binding must be specified per-thread, per the docs. Fixes #1820.
This commit is contained in:
parent
3147716022
commit
0ad4956c06
|
@ -1027,10 +1027,11 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface)
|
||||||
|
|
||||||
/* Bind the API */
|
/* Bind the API */
|
||||||
if (profile_es) {
|
if (profile_es) {
|
||||||
_this->egl_data->eglBindAPI(EGL_OPENGL_ES_API);
|
_this->egl_data->apitype = EGL_OPENGL_ES_API;
|
||||||
} else {
|
} else {
|
||||||
_this->egl_data->eglBindAPI(EGL_OPENGL_API);
|
_this->egl_data->apitype = EGL_OPENGL_API;
|
||||||
}
|
}
|
||||||
|
_this->egl_data->eglBindAPI(_this->egl_data->apitype);
|
||||||
|
|
||||||
egl_context = _this->egl_data->eglCreateContext(_this->egl_data->egl_display,
|
egl_context = _this->egl_data->eglCreateContext(_this->egl_data->egl_display,
|
||||||
_this->egl_data->egl_config,
|
_this->egl_data->egl_config,
|
||||||
|
@ -1108,6 +1109,11 @@ SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Make sure current thread has a valid API bound to it. */
|
||||||
|
if (_this->egl_data->eglBindAPI) {
|
||||||
|
_this->egl_data->eglBindAPI(_this->egl_data->apitype);
|
||||||
|
}
|
||||||
|
|
||||||
/* The android emulator crashes badly if you try to eglMakeCurrent
|
/* The android emulator crashes badly if you try to eglMakeCurrent
|
||||||
* with a valid context and invalid surface, so we have to check for both here.
|
* with a valid context and invalid surface, so we have to check for both here.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -115,9 +115,8 @@ typedef struct SDL_EGL_VideoData
|
||||||
|
|
||||||
/* Atomic functions end */
|
/* Atomic functions end */
|
||||||
|
|
||||||
|
SDL_bool is_offscreen; /* whether EGL display was offscreen */
|
||||||
/* whether EGL display was offscreen */
|
EGLenum apitype; /* EGL_OPENGL_ES_API, EGL_OPENGL_API, etc */
|
||||||
SDL_bool is_offscreen;
|
|
||||||
} SDL_EGL_VideoData;
|
} SDL_EGL_VideoData;
|
||||||
|
|
||||||
/* OpenGLES functions */
|
/* OpenGLES functions */
|
||||||
|
|
Loading…
Reference in New Issue