浏览代码

Removed EGL dlopen.

Camilla Berglund 12 年之前
父节点
当前提交
7ff86576e3
共有 5 个文件被更改,包括 1 次插入84 次删除
  1. 0 29
      CMakeLists.txt
  2. 0 3
      src/config.h.in
  3. 1 34
      src/egl_context.c
  4. 0 14
      src/egl_platform.h
  5. 0 4
      src/x11_init.c

+ 0 - 29
CMakeLists.txt

@@ -241,35 +241,6 @@ if (_GLFW_EGL)
 
     if (_GLFW_X11)
         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()

+ 0 - 3
src/config.h.in

@@ -72,9 +72,6 @@
 // Define this to 1 if glXGetProcAddressEXT is available
 #cmakedefine _GLFW_HAS_GLXGETPROCADDRESSEXT
 
-// Define this to 1 if eglGetProcAddress is available
-#cmakedefine _GLFW_HAS_EGLGETPROCADDRESS
-
 // The GLFW version as used by glfwGetVersionString
 #define _GLFW_VERSION_FULL "@GLFW_VERSION_FULL@"
 

+ 1 - 34
src/egl_context.c

@@ -359,31 +359,6 @@ static int createContext(_GLFWwindow* window,
 
 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);
     if (_glfw.egl.display == EGL_NO_DISPLAY)
     {
@@ -412,14 +387,6 @@ int _glfwInitOpenGL(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);
 }
 
@@ -599,6 +566,6 @@ int _glfwPlatformExtensionSupported(const char* extension)
 
 GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
 {
-    return _glfw_eglGetProcAddress(procname);
+    return eglGetProcAddress(procname);
 }
 

+ 0 - 14
src/egl_platform.h

@@ -43,17 +43,6 @@
  #include <dlfcn.h>
 #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_LIBRARY_OPENGL_STATE _GLFWlibraryEGL egl
 
@@ -87,9 +76,6 @@ typedef struct _GLFWlibraryEGL
 
     GLboolean       KHR_create_context;
 
-#if defined(_GLFW_DLOPEN_LIBEGL)
-    void*           libEGL;  // dlopen handle for libEGL.so
-#endif
 } _GLFWlibraryEGL;
 
 

+ 0 - 4
src/x11_init.c

@@ -708,12 +708,8 @@ const char* _glfwPlatformGetVersionString(void)
         " glXGetProcAddressARB"
 #elif defined(_GLFW_HAS_GLXGETPROCADDRESSEXT)
         " glXGetProcAddressEXT"
-#elif defined(_GLFW_HAS_EGLGETPROCADDRESS)
-        " eglGetProcAddress"
 #elif defined(_GLFW_DLOPEN_LIBGL)
         " dlsym(libGL)"
-#elif defined(_GLFW_DLOPEN_LIBEGL)
-        " dlsym(libEGL)"
 #else
         " no-extension-support"
 #endif