Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed bug 4669: Android software renderer, black screen when window r…
…esizes

Using the software SDL_Renderer on Android leads to GL errors & black screen when window resizes
  • Loading branch information
1bsyl committed Jun 17, 2019
1 parent 6c4765a commit f2157b6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/android/SDL_android.c
Expand Up @@ -732,7 +732,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeResize)(

if (Android_Window)
{
Android_SendResize(Android_Window);
Android_send_resize = 1;
}

SDL_UnlockMutex(Android_ActivityMutex);
Expand Down
5 changes: 5 additions & 0 deletions src/video/android/SDL_androidevents.c
Expand Up @@ -66,6 +66,11 @@ android_egl_context_restore(SDL_Window *window)
event.type = SDL_RENDER_DEVICE_RESET;
SDL_PushEvent(&event);
}

if (Android_send_resize) {
Android_send_resize = 0;
Android_SendResize(window);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/video/android/SDL_androidvideo.c
Expand Up @@ -69,6 +69,7 @@ static int Android_ScreenRate = 0;
SDL_sem *Android_PauseSem = NULL;
SDL_sem *Android_ResumeSem = NULL;
SDL_mutex *Android_ActivityMutex = NULL;
int Android_send_resize = 0;

static int
Android_Available(void)
Expand Down
1 change: 1 addition & 0 deletions src/video/android/SDL_androidvideo.h
Expand Up @@ -44,6 +44,7 @@ extern int Android_SurfaceWidth;
extern int Android_SurfaceHeight;
extern SDL_sem *Android_PauseSem, *Android_ResumeSem;
extern SDL_mutex *Android_ActivityMutex;
extern int Android_send_resize;

#endif /* SDL_androidvideo_h_ */

Expand Down

0 comments on commit f2157b6

Please sign in to comment.