Make SDL_VIDEO_OPENGL_EGL optional on Android

This commit is contained in:
Guus Waals 2022-03-11 15:14:51 +01:00 committed by Sylvain Becker
parent 0ad606b48d
commit 7495b98141
6 changed files with 29 additions and 2 deletions

View file

@ -1009,6 +1009,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceChanged)(JNIEnv *env, j
{
SDL_LockMutex(Android_ActivityMutex);
#if SDL_VIDEO_OPENGL_EGL
if (Android_Window)
{
SDL_VideoDevice *_this = SDL_GetVideoDevice();
@ -1021,6 +1022,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceChanged)(JNIEnv *env, j
/* GL Context handling is done in the event loop because this function is run from the Java thread */
}
#endif
SDL_UnlockMutex(Android_ActivityMutex);
}
@ -1051,10 +1053,12 @@ retry:
}
}
#if SDL_VIDEO_OPENGL_EGL
if (data->egl_surface != EGL_NO_SURFACE) {
SDL_EGL_DestroySurface(_this, data->egl_surface);
data->egl_surface = EGL_NO_SURFACE;
}
#endif
if (data->native_window) {
ANativeWindow_release(data->native_window);