Commit 63d259edf05a291dfaf518f9ab9c064ed8dc44f5

Sam Lantinga 2023-10-26T17:07:40

Fixed making the EGL context current when resuming on Android Make sure that we don't have the context cached as current on the current thread. (cherry picked from commit 8b6da3c7017935932357a0decee84dc6167ace17) (cherry picked from commit 832afa81a17098ec011cf3df14fdc9457ec8f36b)

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/video/android/SDL_androidevents.c b/src/video/android/SDL_androidevents.c
index ad669f8..b152398 100644
--- a/src/video/android/SDL_androidevents.c
+++ b/src/video/android/SDL_androidevents.c
@@ -74,6 +74,7 @@ static void android_egl_context_restore(SDL_Window *window)
     if (window) {
         SDL_Event event;
         SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
+        SDL_GL_MakeCurrent(window, NULL);
         if (SDL_GL_MakeCurrent(window, (SDL_GLContext)data->egl_context) < 0) {
             /* The context is no longer valid, create a new one */
             data->egl_context = (EGLContext)SDL_GL_CreateContext(window);