88#include < mutex>
99#include < string>
1010
11- // Optional GLX fallback for resolving non-extension gl* names via glXGetProcAddress*.
11+ // GLX fallback for resolving non-extension gl* names via glXGetProcAddress*.
1212//
1313// Default behavior is conservative: only extension-style names are resolved via
1414// glXGetProcAddress*, because some implementations return non-null for unknown
1515// symbols which may crash when called.
1616//
1717// If support for legacy/non-GLVND stacks is required where some core entry points are not
1818// exported from libGL/libOpenGL, you may enable this as a last-resort fallback.
19- #ifndef PLATFORM_GLX_ALLOW_CORE_GETPROCADDRESS_FALLBACK
20- #define PLATFORM_GLX_ALLOW_CORE_GETPROCADDRESS_FALLBACK 0
19+ #ifndef GLRESOLVER_GLX_ALLOW_CORE_GETPROCADDRESS_FALLBACK
20+ #define GLRESOLVER_GLX_ALLOW_CORE_GETPROCADDRESS_FALLBACK 0
2121#endif
2222
2323namespace libprojectM
@@ -111,9 +111,6 @@ using UserResolver = void* (*)(const char* name, void* userData);
111111 *
112112 * Compile-time switches:
113113 *
114- * - GLRESOLVER_LOADER_DIAGNOSTICS=1
115- * When enabled, the loader prints diagnostics for unusual ABI situations. Default is disabled.
116- *
117114 * - GLRESOLVER_ALLOW_UNSAFE_DLL_SEARCH=1 (legacy Windows only)
118115 * If the OS loader does not support LOAD_LIBRARY_SEARCH_* flags (ERROR_INVALID_PARAMETER),
119116 * this loader tries to load from explicit safe locations (application directory and
@@ -122,6 +119,13 @@ using UserResolver = void* (*)(const char* name, void* userData);
122119 * (which can consult legacy search paths such as the process current working directory).
123120 * This is disabled by default for security hardening.
124121 *
122+ * - GLRESOLVER_GLX_ALLOW_CORE_GETPROCADDRESS_FALLBACK=1
123+ * Enable GLX fallback for resolving non-extension gl* names via glXGetProcAddress*.
124+ * Disabled by default.
125+ *
126+ * - GLRESOLVER_LOADER_DIAGNOSTICS=1
127+ * When enabled, the loader prints diagnostics for unusual ABI situations. Default is disabled.
128+ *
125129 * - USE_GLES
126130 * Switch for compile-time API selection:
127131 *
@@ -154,7 +158,7 @@ using UserResolver = void* (*)(const char* name, void* userData);
154158 * - EGL: Try to resolve function via eglGetProcAddress as fallback.
155159 * Always enabled.
156160 * - GLX: Try to resolve function via glXGetProcAddress as fallback.
157- * Optional, enabled via PLATFORM_GLX_ALLOW_CORE_GETPROCADDRESS_FALLBACK .
161+ * Optional, enabled via GLRESOLVER_GLX_ALLOW_CORE_GETPROCADDRESS_FALLBACK .
158162 *
159163 * Resolution order (Emscripten/WebGL):
160164 *
@@ -345,24 +349,24 @@ class GLResolver
345349 */
346350 struct CurrentContextProbe
347351 {
348- bool eglLibOpened{false };
349- bool eglAvailable{false };
350- bool eglCurrent{false };
352+ bool eglLibOpened{false }; // !< True if an EGL library was opened.
353+ bool eglAvailable{false }; // !< True if EGL entry points were resolved.
354+ bool eglCurrent{false }; // !< True if an EGL context appears current.
351355
352- bool glxLibOpened{false };
353- bool glxAvailable{false };
354- bool glxCurrent{false };
356+ bool glxLibOpened{false }; // !< True if a GLX library was opened.
357+ bool glxAvailable{false }; // !< True if GLX entry points were resolved.
358+ bool glxCurrent{false }; // !< True if a GLX context appears current.
355359
356- bool wglLibOpened{false };
357- bool wglAvailable{false };
358- bool wglCurrent{false };
360+ bool wglLibOpened{false }; // !< True if a WGL library was opened.
361+ bool wglAvailable{false }; // !< True if WGL entry points were resolved.
362+ bool wglCurrent{false }; // !< True if a WGL context appears current.
359363
360364 bool cglLibOpened{false };
361- bool cglAvailable{false };
362- bool cglCurrent{false };
365+ bool cglAvailable{false }; // !< True if CGL entry points were resolved.
366+ bool cglCurrent{false }; // !< True if a CGL context appears current.
363367
364- bool webglAvailable{false };
365- bool webglCurrent{false };
368+ bool webglAvailable{false }; // !< True if WebGL entry points were resolved.
369+ bool webglCurrent{false }; // !< True if a WebGL context appears current.
366370 };
367371
368372 /* *
0 commit comments