From 9d9e92cf46ab47049465c15047f73bb8211ea72a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 8 Jan 2017 10:41:22 -0800 Subject: [PATCH] Fixed bug 3304 - Android black screen on resume Richard Russell Resuming from a suspended state results in a black screen. This only happens when using GLES 1.1 (GLES 2 resumes correctly) and when the render target has been changed using SDL_SetRenderTarget. This problem is new in 2.0.4. The attached test case demonstrates the issue. Sylvain Becker has apparently found a fix as follows: "In the opengles leaf function (in 'src/render/opengles/SDL_render_gles.c'), it appears there is a call to 'GLES_ActivateRenderer' in 'GLES_SetRenderTarget', which is not present in opengles2. When commenting out this 'GLES_ActivateRenderer', it seems to resume fine". This appears to fix the testcase perfectly, but I don't know whether it could have any undesirable side-effects. --- src/render/opengles/SDL_render_gles.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/render/opengles/SDL_render_gles.c b/src/render/opengles/SDL_render_gles.c index e039d5c63..86fb8c506 100644 --- a/src/render/opengles/SDL_render_gles.c +++ b/src/render/opengles/SDL_render_gles.c @@ -633,8 +633,6 @@ GLES_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) GLES_TextureData *texturedata = NULL; GLenum status; - GLES_ActivateRenderer(renderer); - if (!data->GL_OES_framebuffer_object_supported) { return SDL_SetError("Can't enable render target support in this renderer"); }