Android: restore main-window EGL surface recreation (#4055)

Use the main swap-chain native window on Android EGL reset so a replacement ANativeWindow can receive a new EGLSurface without destroying the existing EGLContext and GPU resources.

Forward native-window lifecycle events through the Android example event queue and include the current window in its reset descriptor. Document Android main-window rebinding support.

Restores the intent of #796 after the example harness platform-data removal (72cbe8327) and swap-chain API refactor (#3959).
This commit is contained in:
Thomas Edvalson
2026-10-16 08:47:05 -07:00
committed by GitHub
parent fd541f0586
commit 99b7977fe2
4 changed files with 33 additions and 1 deletions
+3
View File
@@ -226,6 +226,7 @@ namespace entry
DBG("ANativeWindow width %d, height %d", width, height);
WindowHandle defaultWindow = { 0 };
m_eventQueue.postWindowEvent(defaultWindow, m_window);
m_eventQueue.postSizeEvent(defaultWindow, width, height);
if (!m_thread.isRunning() )
@@ -240,6 +241,8 @@ namespace entry
// terminated. Upon receiving this command, android_app->window still
// contains the existing window; after calling android_app_exec_cmd
// it will be set to NULL.
m_window = NULL;
m_eventQueue.postWindowEvent({ 0 });
break;
case APP_CMD_WINDOW_RESIZED: