mirror of https://github.com/encounter/SDL.git
Maybe fixes bug #2291 (red tinted screen on some Samsung Android devices)
Then again, maybe not!
This commit is contained in:
parent
321af03ff9
commit
5a3c553d0a
|
@ -449,7 +449,7 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface)
|
||||||
else {
|
else {
|
||||||
context_attrib_list[0] = EGL_NONE;
|
context_attrib_list[0] = EGL_NONE;
|
||||||
}
|
}
|
||||||
#else /* EGL_KHR_create_context*/
|
#else /* EGL_KHR_create_context */
|
||||||
context_attrib_list[0] = EGL_NONE;
|
context_attrib_list[0] = EGL_NONE;
|
||||||
#endif /* EGL_KHR_create_context */
|
#endif /* EGL_KHR_create_context */
|
||||||
egl_context = _this->egl_data->eglCreateContext(_this->egl_data->egl_display,
|
egl_context = _this->egl_data->eglCreateContext(_this->egl_data->egl_display,
|
||||||
|
@ -552,10 +552,23 @@ SDL_EGL_DeleteContext(_THIS, SDL_GLContext context)
|
||||||
EGLSurface *
|
EGLSurface *
|
||||||
SDL_EGL_CreateSurface(_THIS, NativeWindowType nw)
|
SDL_EGL_CreateSurface(_THIS, NativeWindowType nw)
|
||||||
{
|
{
|
||||||
|
EGLint format;
|
||||||
|
|
||||||
if (SDL_EGL_ChooseConfig(_this) != 0) {
|
if (SDL_EGL_ChooseConfig(_this) != 0) {
|
||||||
return EGL_NO_SURFACE;
|
return EGL_NO_SURFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if __ANDROID__
|
||||||
|
/* Android docs recommend doing this!
|
||||||
|
* Ref: http://developer.android.com/reference/android/app/NativeActivity.html
|
||||||
|
*/
|
||||||
|
_this->egl_data->eglGetConfigAttrib(_this->egl_data->egl_display,
|
||||||
|
_this->egl_data->egl_config,
|
||||||
|
EGL_NATIVE_VISUAL_ID, &format);
|
||||||
|
|
||||||
|
ANativeWindow_setBuffersGeometry(nw, 0, 0, format);
|
||||||
|
#endif
|
||||||
|
|
||||||
return _this->egl_data->eglCreateWindowSurface(
|
return _this->egl_data->eglCreateWindowSurface(
|
||||||
_this->egl_data->egl_display,
|
_this->egl_data->egl_display,
|
||||||
_this->egl_data->egl_config,
|
_this->egl_data->egl_config,
|
||||||
|
|
Loading…
Reference in New Issue