Simplified glXGetProcAddress logic.

Removed compile-time selection of GLX entry point retrieval mechanism.
Made dlopen a required dependency.

This is a stopgap solution until we start requiring GLX 1.4.
This commit is contained in:
Camilla Berglund
2015-05-27 01:06:36 +02:00
parent 8309e0ecb0
commit 3c52cb1790
8 changed files with 32 additions and 92 deletions
+6 -26
View File
@@ -34,29 +34,9 @@
// This path may need to be changed if you build GLFW using your own setup
// We ship and use our own copy of glxext.h since GLFW uses fairly new
// extensions and not all operating systems come with an up-to-date version
#define GLX_GLXEXT_PROTOTYPES
#include "../deps/GL/glxext.h"
// Do we have support for dlopen/dlsym?
#if defined(_GLFW_HAS_DLOPEN)
#include <dlfcn.h>
#endif
// We support four different ways for getting addresses for GL/GLX
// extension functions: glXGetProcAddress, glXGetProcAddressARB,
// glXGetProcAddressEXT, and dlsym
#if defined(_GLFW_HAS_GLXGETPROCADDRESSARB)
#define _glfw_glXGetProcAddress(x) glXGetProcAddressARB(x)
#elif defined(_GLFW_HAS_GLXGETPROCADDRESS)
#define _glfw_glXGetProcAddress(x) glXGetProcAddress(x)
#elif defined(_GLFW_HAS_GLXGETPROCADDRESSEXT)
#define _glfw_glXGetProcAddress(x) glXGetProcAddressEXT(x)
#elif defined(_GLFW_HAS_DLOPEN)
#define _glfw_glXGetProcAddress(x) dlsym(_glfw.glx.libGL, x)
#define _GLFW_DLOPEN_LIBGL
#else
#error "No OpenGL entry point retrieval mechanism was enabled"
#endif
#define _GLFW_PLATFORM_FBCONFIG GLXFBConfig glx
#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextGLX glx
#define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryGLX glx
@@ -86,7 +66,12 @@ typedef struct _GLFWlibraryGLX
int eventBase;
int errorBase;
// dlopen handle for libGL.so.1
void* handle;
// GLX extensions
PFNGLXGETPROCADDRESSPROC GetProcAddress;
PFNGLXGETPROCADDRESSPROC GetProcAddressARB;
PFNGLXSWAPINTERVALSGIPROC SwapIntervalSGI;
PFNGLXSWAPINTERVALEXTPROC SwapIntervalEXT;
PFNGLXSWAPINTERVALMESAPROC SwapIntervalMESA;
@@ -102,11 +87,6 @@ typedef struct _GLFWlibraryGLX
GLboolean EXT_create_context_es2_profile;
GLboolean ARB_context_flush_control;
#if defined(_GLFW_DLOPEN_LIBGL)
// dlopen handle for libGL.so (for glfwGetProcAddress)
void* libGL;
#endif
} _GLFWlibraryGLX;