Split platform-specific global data.

This commit is contained in:
Camilla Berglund
2012-04-22 15:53:02 +02:00
parent 2ac8da7465
commit 21e77fe1a6
8 changed files with 55 additions and 25 deletions
+16 -7
View File
@@ -75,15 +75,16 @@
#elif defined(_GLFW_HAS_GLXGETPROCADDRESSEXT)
#define _glfw_glXGetProcAddress(x) glXGetProcAddressEXT(x)
#elif defined(_GLFW_HAS_DLOPEN)
#define _glfw_glXGetProcAddress(x) dlsym(_glfwLibrary.X11.libGL, x)
#define _glfw_glXGetProcAddress(x) dlsym(_glfwLibrary.GLX.libGL, x)
#define _GLFW_DLOPEN_LIBGL
#else
#error "No OpenGL entry point retrieval mechanism was enabled"
#endif
#define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowX11 X11
#define _GLFW_PLATFORM_LIBRARY_STATE _GLFWlibraryX11 X11
#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextGLX GLX
#define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryX11 X11
#define _GLFW_PLATFORM_LIBRARY_OPENGL_STATE _GLFWlibraryGLX GLX
// Clipboard format atom indices
#define _GLFW_CLIPBOARD_FORMAT_UTF8 0
@@ -157,7 +158,7 @@ typedef struct _GLFWwindowX11
//------------------------------------------------------------------------
// Platform-specific library global data
// Platform-specific library global data for X11
//------------------------------------------------------------------------
typedef struct _GLFWlibraryX11
{
@@ -177,9 +178,6 @@ typedef struct _GLFWlibraryX11
// True if window manager supports EWMH
GLboolean hasEWMH;
// Server-side GLX version
int glxMajor, glxMinor;
struct {
GLboolean available;
int eventBase;
@@ -248,10 +246,21 @@ typedef struct _GLFWlibraryX11
int status;
} selection;
} _GLFWlibraryX11;
//------------------------------------------------------------------------
// Platform-specific library global data for GLX
//------------------------------------------------------------------------
typedef struct _GLFWlibraryGLX
{
// Server-side GLX version
int majorVersion, minorVersion;
#if defined(_GLFW_DLOPEN_LIBGL)
void* libGL; // dlopen handle for libGL.so
#endif
} _GLFWlibraryX11;
} _GLFWlibraryGLX;
//------------------------------------------------------------------------