[Fix] (MG_Util): Skip GLES initializing if the libs do not exist.

This commit is contained in:
BZLZHH
2026-01-01 11:32:12 +08:00
parent 876195de80
commit e4f027e13b
4 changed files with 17 additions and 6 deletions
+10 -3
View File
@@ -40,16 +40,19 @@ namespace MobileGL {
}
}
void InitSpecificBackendLibs() {
Bool InitSpecificBackendLibs() {
#if MOBILEGL_BACKEND == MOBILEGL_BACKEND_DILIGENT
// Nothing to do
MGLOG_D("Diligent Engine backend loaded");
return true;
#elif MOBILEGL_BACKEND == MOBILEGL_BACKEND_TYPE_DIRECT_GLES
MG_Util::BackendLoader::GLES::Init();
Bool result = MG_Util::BackendLoader::GLES::Init();
MGLOG_D("DirectGLES backend loaded, GLES version: %d.%d", MG_External::GLES::g_glesCaps.version.Major,
MG_External::GLES::g_glesCaps.version.Minor);
return result;
#else
MGLOG_W("Unknown backend, skipping backend initialization");
return false;
#endif
}
@@ -73,7 +76,11 @@ namespace MobileGL {
MG_Config::RendererInfoPtr = MakeUnique<RendererInfo>(Unknown::RendererInfoUnknown);
#endif
InitSpecificBackendLibs();
Bool result = InitSpecificBackendLibs();
if (!result) {
MGLOG_W("Failed to initialize MobileGL backend libraries");
return;
}
LogBackendInfo();
}
} // namespace MG_Backend