[Fix] (MG_Impl): preserve macOS surface during resize

This commit is contained in:
2026-06-29 21:07:12 +08:00
parent ef06d90b6b
commit cca4df17d9
11 changed files with 110 additions and 2 deletions
@@ -434,6 +434,23 @@ namespace MobileGL::MG_Backend::DirectVulkan {
return BackendObject::CreateEGLWindowSurface(handle);
}
Bool BackendObject_DirectVulkan::ResizeEGLWindowSurface(Uint32 width, Uint32 height) {
const std::lock_guard<std::recursive_mutex> lock(m_eglStateMutex);
if (!m_initialized) {
MGLOG_E("DirectVulkan backend not initialized");
return false;
}
if (!pVulkanRenderer) {
MGLOG_E("DirectVulkan renderer is not initialized");
return false;
}
if (!BackendObject::ResizeEGLWindowSurface(width, height)) {
return false;
}
pVulkanRenderer->RequestSwapchainResize(width, height);
return true;
}
Bool BackendObject_DirectVulkan::CreateEGLPbufferSurface(EGLint width, EGLint height) {
const std::lock_guard<std::recursive_mutex> lock(m_eglStateMutex);
if (!m_initialized) {