From 3f15f721fc66ed729b8d1f6b03c90caec8930813 Mon Sep 17 00:00:00 2001 From: keeper-of-memes Date: Mon, 6 Jul 2026 11:37:50 +0100 Subject: [PATCH] GLResolver: fall back to app-managed EGL/GLES when a user resolver is set On platforms where the current GL context cannot be probed via the platform's native APIs (e.g. ANGLE on tvOS/iOS, where the app owns an EGL context backed by Metal and there is no system EGL/GLX/WGL to query), GLResolver::Initialize() failed hard even though the embedding application had explicitly supplied a resolver via projectm_create_with_opengl_load_proc(). When a user resolver is present, the app has taken responsibility for providing GL entry points, so an unprobeable context is expected rather than an error: assume an app-managed EGL/GLES context and continue, logging at info level. Behaviour without a user resolver is unchanged (hard error as before). --- .../Renderer/Platform/GLResolver.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/libprojectM/Renderer/Platform/GLResolver.cpp b/src/libprojectM/Renderer/Platform/GLResolver.cpp index 21eb4acaa0..6dcb293aec 100644 --- a/src/libprojectM/Renderer/Platform/GLResolver.cpp +++ b/src/libprojectM/Renderer/Platform/GLResolver.cpp @@ -404,9 +404,20 @@ auto GLResolver::Initialize(UserResolver resolver, void* userData) -> bool std::string reason; if (!HasCurrentContext(currentContext, reason)) { - m_loaded = false; - LOG_ERROR(std::string("[GLResolver] No current GL context present: ") + reason); - return false; + if (state.m_userResolver != nullptr) + { + currentContext.eglCurrent = true; + currentContext.eglAvailable = true; + LOG_INFO(std::string("[GLResolver] Current context could not be probed: ") + + reason + + "; assuming app-managed EGL/GLES context because a user resolver was supplied"); + } + else + { + m_loaded = false; + LOG_ERROR(std::string("[GLResolver] No current GL context present: ") + reason); + return false; + } } }