From 1aa34606e7c4313eee299e0c4fc01cfeb93ec47d Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 4 Jan 2013 03:54:52 +0100 Subject: [PATCH 1/2] Fixes for use with the AMD EGL/GLES SDK. --- CMakeLists.txt | 2 ++ src/egl_context.c | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba257c95..5838b1c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -270,6 +270,8 @@ if (_GLFW_EGL) set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -ldl") endif() endif() + elseif (_GLFW_WIN32) + set(_GLFW_HAS_EGLGETPROCADDRESS 1) endif() endif() diff --git a/src/egl_context.c b/src/egl_context.c index 95a0ba22..7e58b037 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -109,11 +109,13 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, { _GLFWfbconfig* f = result + *found; +#if defined(_GLFW_X11) if (!getConfigAttrib(configs[i], EGL_NATIVE_VISUAL_ID)) { // Only consider EGLConfigs with associated visuals continue; } +#endif // _GLFW_X11 if (!(getConfigAttrib(configs[i], EGL_COLOR_BUFFER_TYPE) & EGL_RGB_BUFFER)) { @@ -255,7 +257,7 @@ static int createContext(_GLFWwindow* window, return GL_FALSE; } } -#endif +#endif // _GLFW_X11 if (wndconfig->clientAPI == GLFW_OPENGL_ES_API) { @@ -472,11 +474,13 @@ int _glfwCreateContext(_GLFWwindow* window, void _glfwDestroyContext(_GLFWwindow* window) { +#if _GLFW_X11 if (window->egl.visual) { XFree(window->egl.visual); window->egl.visual = NULL; } +#endif // _GLFW_X11 if (window->egl.surface) { @@ -500,7 +504,7 @@ int _glfwAnalyzeContext(const _GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* fbconfig) { -#if _GLFW_WIN32 +#if defined(_GLFW_WIN32) return _GLFW_RECREATION_NOT_NEEDED; #else return 0; From b35855cfb57ee898bb6ca5b7af1455fcca3e4a66 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 4 Jan 2013 03:56:33 +0100 Subject: [PATCH 2/2] Formatting. --- src/egl_context.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/egl_context.c b/src/egl_context.c index 7e58b037..fc41f2c6 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -361,7 +361,7 @@ static int createContext(_GLFWwindow* window, int _glfwInitOpenGL(void) { -#ifdef _GLFW_DLOPEN_LIBEGL +#if defined(_GLFW_DLOPEN_LIBEGL) int i; char* libEGL_names[ ] = { @@ -414,7 +414,7 @@ int _glfwInitOpenGL(void) void _glfwTerminateOpenGL(void) { -#ifdef _GLFW_DLOPEN_LIBEGL +#if defined(_GLFW_DLOPEN_LIBEGL) if (_glfw.egl.libEGL != NULL) { dlclose(_glfw.egl.libEGL); @@ -474,7 +474,7 @@ int _glfwCreateContext(_GLFWwindow* window, void _glfwDestroyContext(_GLFWwindow* window) { -#if _GLFW_X11 +#if defined(_GLFW_X11) if (window->egl.visual) { XFree(window->egl.visual);