mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-27 04:28:52 -05:00
Removed EGL dlopen.
This commit is contained in:
parent
2757b0fa6f
commit
7ff86576e3
|
@ -241,35 +241,6 @@ if (_GLFW_EGL)
|
||||||
|
|
||||||
if (_GLFW_X11)
|
if (_GLFW_X11)
|
||||||
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} egl")
|
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} egl")
|
||||||
|
|
||||||
include(CheckFunctionExists)
|
|
||||||
|
|
||||||
check_function_exists(eglGetProcAddress _GLFW_HAS_EGLGETPROCADDRESS)
|
|
||||||
|
|
||||||
if (NOT _GLFW_HAS_EGLGETPROCADDRESS)
|
|
||||||
message(WARNING "No eglGetProcAddress found")
|
|
||||||
|
|
||||||
# Check for dlopen support as a fallback
|
|
||||||
|
|
||||||
find_library(DL_LIBRARY dl)
|
|
||||||
mark_as_advanced(DL_LIBRARY)
|
|
||||||
if (DL_LIBRARY)
|
|
||||||
set(CMAKE_REQUIRED_LIBRARIES ${DL_LIBRARY})
|
|
||||||
else()
|
|
||||||
set(CMAKE_REQUIRED_LIBRARIES "")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
check_function_exists(dlopen _GLFW_HAS_DLOPEN)
|
|
||||||
|
|
||||||
if (NOT _GLFW_HAS_DLOPEN)
|
|
||||||
message(FATAL_ERROR "No entry point retrieval mechanism found")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (DL_LIBRARY)
|
|
||||||
list(APPEND glfw_LIBRARIES ${DL_LIBRARY})
|
|
||||||
set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -ldl")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -72,9 +72,6 @@
|
||||||
// Define this to 1 if glXGetProcAddressEXT is available
|
// Define this to 1 if glXGetProcAddressEXT is available
|
||||||
#cmakedefine _GLFW_HAS_GLXGETPROCADDRESSEXT
|
#cmakedefine _GLFW_HAS_GLXGETPROCADDRESSEXT
|
||||||
|
|
||||||
// Define this to 1 if eglGetProcAddress is available
|
|
||||||
#cmakedefine _GLFW_HAS_EGLGETPROCADDRESS
|
|
||||||
|
|
||||||
// The GLFW version as used by glfwGetVersionString
|
// The GLFW version as used by glfwGetVersionString
|
||||||
#define _GLFW_VERSION_FULL "@GLFW_VERSION_FULL@"
|
#define _GLFW_VERSION_FULL "@GLFW_VERSION_FULL@"
|
||||||
|
|
||||||
|
|
|
@ -359,31 +359,6 @@ static int createContext(_GLFWwindow* window,
|
||||||
|
|
||||||
int _glfwInitOpenGL(void)
|
int _glfwInitOpenGL(void)
|
||||||
{
|
{
|
||||||
#ifdef _GLFW_DLOPEN_LIBEGL
|
|
||||||
int i;
|
|
||||||
char* libEGL_names[ ] =
|
|
||||||
{
|
|
||||||
"libEGL.so",
|
|
||||||
"libEGL.so.1",
|
|
||||||
"/usr/lib/libEGL.so",
|
|
||||||
"/usr/lib/libEGL.so.1",
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
for (i = 0; libEGL_names[i] != NULL; i++)
|
|
||||||
{
|
|
||||||
_glfw.egl.libEGL = dlopen(libEGL_names[i], RTLD_LAZY | RTLD_GLOBAL);
|
|
||||||
if (_glfw.egl.libEGL)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_glfw.egl.libEGL)
|
|
||||||
{
|
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR, "EGL: Failed to find libEGL");
|
|
||||||
return GL_FALSE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_glfw.egl.display = eglGetDisplay(_GLFW_EGL_NATIVE_DISPLAY);
|
_glfw.egl.display = eglGetDisplay(_GLFW_EGL_NATIVE_DISPLAY);
|
||||||
if (_glfw.egl.display == EGL_NO_DISPLAY)
|
if (_glfw.egl.display == EGL_NO_DISPLAY)
|
||||||
{
|
{
|
||||||
|
@ -412,14 +387,6 @@ int _glfwInitOpenGL(void)
|
||||||
|
|
||||||
void _glfwTerminateOpenGL(void)
|
void _glfwTerminateOpenGL(void)
|
||||||
{
|
{
|
||||||
#ifdef _GLFW_DLOPEN_LIBEGL
|
|
||||||
if (_glfw.egl.libEGL != NULL)
|
|
||||||
{
|
|
||||||
dlclose(_glfw.egl.libEGL);
|
|
||||||
_glfw.egl.libEGL = NULL;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
eglTerminate(_glfw.egl.display);
|
eglTerminate(_glfw.egl.display);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -599,6 +566,6 @@ int _glfwPlatformExtensionSupported(const char* extension)
|
||||||
|
|
||||||
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
||||||
{
|
{
|
||||||
return _glfw_eglGetProcAddress(procname);
|
return eglGetProcAddress(procname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,17 +43,6 @@
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// We support two different ways for getting addresses for EGL
|
|
||||||
// extension functions: eglGetProcAddress and dlsym
|
|
||||||
#if defined(_GLFW_HAS_EGLGETPROCADDRESS)
|
|
||||||
#define _glfw_eglGetProcAddress(x) eglGetProcAddress(x)
|
|
||||||
#elif defined(_GLFW_HAS_DLOPEN)
|
|
||||||
#define _glfw_eglGetProcAddress(x) dlsym(_glfw.egl.libEGL, x)
|
|
||||||
#define _GLFW_DLOPEN_LIBEGL
|
|
||||||
#else
|
|
||||||
#error "No OpenGL entry point retrieval mechanism was enabled"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextEGL egl
|
#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextEGL egl
|
||||||
#define _GLFW_PLATFORM_LIBRARY_OPENGL_STATE _GLFWlibraryEGL egl
|
#define _GLFW_PLATFORM_LIBRARY_OPENGL_STATE _GLFWlibraryEGL egl
|
||||||
|
|
||||||
|
@ -87,9 +76,6 @@ typedef struct _GLFWlibraryEGL
|
||||||
|
|
||||||
GLboolean KHR_create_context;
|
GLboolean KHR_create_context;
|
||||||
|
|
||||||
#if defined(_GLFW_DLOPEN_LIBEGL)
|
|
||||||
void* libEGL; // dlopen handle for libEGL.so
|
|
||||||
#endif
|
|
||||||
} _GLFWlibraryEGL;
|
} _GLFWlibraryEGL;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -708,12 +708,8 @@ const char* _glfwPlatformGetVersionString(void)
|
||||||
" glXGetProcAddressARB"
|
" glXGetProcAddressARB"
|
||||||
#elif defined(_GLFW_HAS_GLXGETPROCADDRESSEXT)
|
#elif defined(_GLFW_HAS_GLXGETPROCADDRESSEXT)
|
||||||
" glXGetProcAddressEXT"
|
" glXGetProcAddressEXT"
|
||||||
#elif defined(_GLFW_HAS_EGLGETPROCADDRESS)
|
|
||||||
" eglGetProcAddress"
|
|
||||||
#elif defined(_GLFW_DLOPEN_LIBGL)
|
#elif defined(_GLFW_DLOPEN_LIBGL)
|
||||||
" dlsym(libGL)"
|
" dlsym(libGL)"
|
||||||
#elif defined(_GLFW_DLOPEN_LIBEGL)
|
|
||||||
" dlsym(libEGL)"
|
|
||||||
#else
|
#else
|
||||||
" no-extension-support"
|
" no-extension-support"
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user