Began decoupling EGL code from X11.

This commit is contained in:
Camilla Berglund 2012-07-20 00:14:52 +02:00
parent 26a843043c
commit 251964f84f
2 changed files with 5 additions and 2 deletions

View File

@ -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)
{

View File

@ -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