@@ -73,7 +73,7 @@ enum class Backend : std::uint8_t
7373using UserResolver = void * (*)(const char * name, void * userData);
7474
7575/* *
76- * @brief Cross -platform runtime GL/GLES procedure resolver.
76+ * @brief Universal cross -platform runtime GL/GLES procedure resolver for GLAD2 (non-MX) .
7777 *
7878 * Compile-time API selection:
7979 * - If USE_GLES is defined, loads OpenGL ES entry points via gladLoadGLES2() and
@@ -84,9 +84,14 @@ using UserResolver = void* (*)(const char* name, void* userData);
8484 * Supported backends/wrappers: EGL (including ANGLE), GLX (including libGLVND), WGL,
8585 * macOS CGL, WebGL (Emscripten), plus an optional user resolver.
8686 *
87+ * Lifecycle:
88+ * - The resolver is a process-singleton.
89+ * - GL libraries that have been opened are not unloaded to avoid conflicts with the host app.
90+ * They will be released by OS during process tear-down.
91+ *
8792 * Initialization:
8893 * - Must be called after a context is created and made current on the calling thread.
89- * - Thread-safe; intended to be called once during startup before any resolution occurs.
94+ * - Thread-safe; intended to be called during startup before any resolution occurs.
9095 * - If multiple backends appear to be current, EGL is preferred.
9196 *
9297 * Resolution order (non-Emscripten):
@@ -96,18 +101,13 @@ using UserResolver = void* (*)(const char* name, void* userData);
96101 * - Queried for all symbols only when EGL_KHR_get_all_proc_addresses or
97102 * EGL_KHR_client_get_all_proc_addresses is advertised.
98103 * - Otherwise queried only for extension-style names during the provider step.
99- * - As a last resort (after exports/global lookups fail), a best-effort call
100- * to eglGetProcAddress may be attempted even for non-extension names to support
101- * stacks that expose core client API entry points only via eglGetProcAddress.
102104 * - GLX: glXGetProcAddressARB / glXGetProcAddress
103- * - Queried only for glX* or extension-style names (default).
104- * - Optional: as a last resort, non-extension gl* names can be queried when
105- * PLATFORM_GLX_ALLOW_CORE_GETPROCADDRESS_FALLBACK is enabled.
105+ * - Queried only for glX* or extension-style names.
106106 * - WGL: wglGetProcAddress
107107 * - Filters sentinel values; prefers exported symbols for core OpenGL 1.1 entry points.
108108 * 3) Global symbol scope lookup (dlsym(RTLD_DEFAULT) / GetProcAddress on already-loaded modules)
109109 * 4) Direct exports from explicitly opened libraries (EGL/GL/GLX)
110- * 5) Fallback
110+ * 5) GetProcAddress fallback
111111 * - EGL: Try to resolve function via eglGetProcAddress as fallback.
112112 * Always enabled.
113113 * - GLX: Try to resolve function via glXGetProcAddress as fallback.
@@ -270,6 +270,7 @@ class GLResolver
270270private:
271271
272272 // Basic EGL access signatures.
273+
273274 using EglProc = void (PLATFORM_EGLAPIENTRY*)();
274275 using EglGetProcAddressFn = EglProc (PLATFORM_EGLAPIENTRY*)(const char * name);
275276 using EglGetCurrentContextFn = void * (PLATFORM_EGLAPIENTRY*)();
0 commit comments