@ -351,34 +351,38 @@ epoxy_current_context_is_glx(void)
* If there ' s a public GetProcAddress loaded in the
* If there ' s a public GetProcAddress loaded in the
* application ' s namespace , then use that .
* application ' s namespace , then use that .
*/
*/
PFNGLXGETPROCADDRESSARBPROC glx_gpa ;
void * sym ;
# if PLATFORM_HAS_EGL
PFNEGLGETPROCADDRESSPROC egl_gpa ;
# endif
glx_gpa = dlsym ( NULL , " glXGetProcAddressARB " ) ;
sym = dlsym ( NULL , " glXGetCurrentContext " ) ;
if ( glx_gpa & & glXGetCurrentContext ( ) )
if ( sym ) {
if ( glXGetCurrentContext ( ) )
return true ;
return true ;
} else {
( void ) dlerror ( ) ;
}
# if PLATFORM_HAS_EGL
# if PLATFORM_HAS_EGL
egl_gpa = dlsym ( NULL , " eglGetProcAddress " ) ;
sym = dlsym ( NULL , " eglGetCurrentContext " ) ;
if ( egl_gpa & & epoxy_egl_get_current_gl_context_api ( ) ! = EGL_NONE )
if ( sym ) {
return false ;
if ( epoxy_egl_get_current_gl_context_api ( ) ! = EGL_NONE )
return true ;
} else {
( void ) dlerror ( ) ;
}
# endif /* PLATFORM_HAS_EGL */
# endif /* PLATFORM_HAS_EGL */
/* OK, couldn't find anything in the app's address space.
/* OK, couldn't find anything in the app's address space.
* Presumably they dlopened with RTLD_LOCAL , which hides it
* Presumably they dlopened with RTLD_LOCAL , which hides it
* from us . Just go dlopen ( ) ing likely libraries and try them .
* from us . Just go dlopen ( ) ing likely libraries and try them .
*/
*/
glx_gpa = do_dlsym ( & api . glx_handle , GLX_LIB , " glXGetProcAddressARB " ,
sym = do_dlsym ( & api . glx_handle , GLX_LIB , " glXGetCurrentContext " , false ) ;
false ) ;
if ( sym & & glXGetCurrentContext ( ) )
if ( glx_gpa & & glXGetCurrentContext ( ) )
return true ;
return true ;
# if PLATFORM_HAS_EGL
# if PLATFORM_HAS_EGL
egl_gpa = do_dlsym ( & api . egl_handle , " libEGL.so.1 " , " eglGetProcAddress " ,
sym = do_dlsym ( & api . egl_handle , " libEGL.so.1 " , " eglGetCurrentContext " ,
false ) ;
false ) ;
if ( egl_gpa & & epoxy_egl_get_current_gl_context_api ( ) ! = EGL_NONE )
if ( sym & & epoxy_egl_get_current_gl_context_api ( ) ! = EGL_NONE )
return false ;
return false ;
# endif /* PLATFORM_HAS_EGL */
# endif /* PLATFORM_HAS_EGL */