From 251964f84f7f81784426370fc5aa05dafab7578e Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 20 Jul 2012 00:14:52 +0200 Subject: [PATCH] Began decoupling EGL code from X11. --- src/x11_egl_opengl.c | 4 ++-- src/x11_egl_platform.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/x11_egl_opengl.c b/src/x11_egl_opengl.c index 3390dbd7..eaefd640 100644 --- a/src/x11_egl_opengl.c +++ b/src/x11_egl_opengl.c @@ -334,7 +334,7 @@ int _glfwInitOpenGL(void) } #endif - _glfwLibrary.EGL.display = eglGetDisplay((EGLNativeDisplayType) _glfwLibrary.X11.display); + _glfwLibrary.EGL.display = eglGetDisplay(_GLFW_EGL_NATIVE_DISPLAY); if (_glfwLibrary.EGL.display == EGL_NO_DISPLAY) { _glfwSetError(GLFW_OPENGL_UNAVAILABLE, @@ -463,7 +463,7 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window) { window->EGL.surface = eglCreateWindowSurface(_glfwLibrary.EGL.display, window->EGL.config, - (EGLNativeWindowType) window->X11.handle, + _GLFW_EGL_NATIVE_WINDOW, NULL); if (window->EGL.surface == EGL_NO_SURFACE) { diff --git a/src/x11_egl_platform.h b/src/x11_egl_platform.h index 769323c4..1ab83f89 100644 --- a/src/x11_egl_platform.h +++ b/src/x11_egl_platform.h @@ -52,6 +52,9 @@ #define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextEGL EGL #define _GLFW_PLATFORM_LIBRARY_OPENGL_STATE _GLFWlibraryEGL EGL +#define _GLFW_EGL_NATIVE_WINDOW ((EGLNativeWindowType) window->X11.handle) +#define _GLFW_EGL_NATIVE_DISPLAY ((EGLNativeDisplayType) _glfwLibrary.X11.display) + //======================================================================== // GLFW platform specific types