From 2815630688ce777f9bd34408ee7365ef04e74b0e Mon Sep 17 00:00:00 2001 From: Cloudef Date: Thu, 26 Apr 2012 02:26:01 +0300 Subject: [PATCH] Reflect X visual changes to EGL code --- src/x11_egl_opengl.c | 14 ++++++++++++++ src/x11_egl_platform.h | 1 + 2 files changed, 15 insertions(+) diff --git a/src/x11_egl_opengl.c b/src/x11_egl_opengl.c index 12bf71f5..923e3e22 100644 --- a/src/x11_egl_opengl.c +++ b/src/x11_egl_opengl.c @@ -401,6 +401,12 @@ int _glfwCreateContext(_GLFWwindow* window, void _glfwDestroyContext(_GLFWwindow* window) { + if (window->EGL.visual) + { + XFree(window->EGL.visual); + window->EGL.visual = NULL; + } + if (window->EGL.surface) { // Release and destroy the surface @@ -416,6 +422,14 @@ void _glfwDestroyContext(_GLFWwindow* window) } } +//======================================================================== +// Return the X visual associated with the specified context +//======================================================================== + +XVisualInfo* _glfwGetContextVisual(_GLFWwindow* window) +{ + return window->EGL.visual; +} //======================================================================== // Make the OpenGL context associated with the specified window current diff --git a/src/x11_egl_platform.h b/src/x11_egl_platform.h index f2fe4092..87ba39a0 100644 --- a/src/x11_egl_platform.h +++ b/src/x11_egl_platform.h @@ -262,6 +262,7 @@ int _glfwCreateContext(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* fbconfig); void _glfwDestroyContext(_GLFWwindow* window); +XVisualInfo* _glfwGetContextVisual(_GLFWwindow* window); // Fullscreen support int _glfwGetClosestVideoMode(int* width, int* height, int* rate);