From 2a166c5086684d6e10d52a879aae92d8dbe53e03 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 22 Nov 2012 20:16:48 +0100 Subject: [PATCH] Removed glfwCopyContext to map better against EGL. --- include/GL/glfw3.h | 7 ------- readme.html | 1 - src/cocoa_opengl.m | 10 ---------- src/internal.h | 1 - src/opengl.c | 29 ----------------------------- src/win32_opengl.c | 14 -------------- src/x11_opengl.c | 13 ------------- tests/sharing.c | 7 +++++-- 8 files changed, 5 insertions(+), 77 deletions(-) diff --git a/include/GL/glfw3.h b/include/GL/glfw3.h index f20fd1c7..525ba478 100644 --- a/include/GL/glfw3.h +++ b/include/GL/glfw3.h @@ -1548,13 +1548,6 @@ GLFWAPI int glfwExtensionSupported(const char* extension); */ GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname); -/*! @brief Copies the desired parts of the state of one window's context to another. - * @ingroup opengl - * - * @remarks This function may be called from secondary threads. - */ -GLFWAPI void glfwCopyContext(GLFWwindow src, GLFWwindow dst, unsigned long mask); - /************************************************************************* * Global definition cleanup diff --git a/readme.html b/readme.html index c2d18be4..81100df6 100644 --- a/readme.html +++ b/readme.html @@ -279,7 +279,6 @@ version of GLFW.

  • Added glfwSetWindowIconifyCallback function and GLFWwindowiconifyfun type for receiving window iconification events
  • Added glfwGetClipboardString and glfwSetClipboardString functions for interacting with the system clipboard
  • Added glfwGetCurrentContext function for retrieving the window whose OpenGL context is current
  • -
  • Added glfwCopyContext function for copying OpenGL state categories between contexts
  • Added GLFW_CLIENT_API, GLFW_OPENGL_API and GLFW_OPENGL_ES_API for selecting client API
  • Added GLFW_OPENGL_ROBUSTNESS window hint and associated strategy tokens for GL_ARB_robustness support
  • Added GLFW_OPENGL_REVISION window parameter to make up for removal of glfwGetGLVersion
  • diff --git a/src/cocoa_opengl.m b/src/cocoa_opengl.m index 4d4c4299..ed024d6e 100644 --- a/src/cocoa_opengl.m +++ b/src/cocoa_opengl.m @@ -147,13 +147,3 @@ GLFWglproc _glfwPlatformGetProcAddress(const char* procname) return symbol; } - -//======================================================================== -// Copies the specified OpenGL state categories from src to dst -//======================================================================== - -void _glfwPlatformCopyContext(_GLFWwindow* src, _GLFWwindow* dst, unsigned long mask) -{ - [dst->NSGL.context copyAttributesFromContext:src->NSGL.context withMask:mask]; -} - diff --git a/src/internal.h b/src/internal.h index c43ad37f..c5a40af3 100644 --- a/src/internal.h +++ b/src/internal.h @@ -309,7 +309,6 @@ void _glfwPlatformSwapInterval(int interval); void _glfwPlatformRefreshWindowParams(_GLFWwindow* window); int _glfwPlatformExtensionSupported(const char* extension); GLFWglproc _glfwPlatformGetProcAddress(const char* procname); -void _glfwPlatformCopyContext(_GLFWwindow* src, _GLFWwindow* dst, unsigned long mask); //======================================================================== diff --git a/src/opengl.c b/src/opengl.c index 482db6ad..538bcdfb 100644 --- a/src/opengl.c +++ b/src/opengl.c @@ -682,32 +682,3 @@ GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname) return _glfwPlatformGetProcAddress(procname); } - -//======================================================================== -// Copies the specified OpenGL state categories from src to dst -//======================================================================== - -GLFWAPI void glfwCopyContext(GLFWwindow hsrc, GLFWwindow hdst, unsigned long mask) -{ - _GLFWwindow* src; - _GLFWwindow* dst; - - if (!_glfwInitialized) - { - _glfwSetError(GLFW_NOT_INITIALIZED, NULL); - return; - } - - src = (_GLFWwindow*) hsrc; - dst = (_GLFWwindow*) hdst; - - if (_glfwPlatformGetCurrentContext() == dst) - { - _glfwSetError(GLFW_INVALID_VALUE, - "glfwCopyContext: Cannot copy OpenGL state to a current context"); - return; - } - - _glfwPlatformCopyContext(src, dst, mask); -} - diff --git a/src/win32_opengl.c b/src/win32_opengl.c index acbf09f5..7689f9c0 100644 --- a/src/win32_opengl.c +++ b/src/win32_opengl.c @@ -637,17 +637,3 @@ GLFWglproc _glfwPlatformGetProcAddress(const char* procname) return (GLFWglproc) wglGetProcAddress(procname); } - -//======================================================================== -// Copies the specified OpenGL state categories from src to dst -//======================================================================== - -void _glfwPlatformCopyContext(_GLFWwindow* src, _GLFWwindow* dst, unsigned long mask) -{ - if (!wglCopyContext(src->WGL.context, dst->WGL.context, mask)) - { - _glfwSetError(GLFW_PLATFORM_ERROR, - "WGL: Failed to copy OpenGL context attributes"); - } -} - diff --git a/src/x11_opengl.c b/src/x11_opengl.c index ccd59d87..790ad062 100644 --- a/src/x11_opengl.c +++ b/src/x11_opengl.c @@ -732,16 +732,3 @@ GLFWglproc _glfwPlatformGetProcAddress(const char* procname) return _glfw_glXGetProcAddress((const GLubyte*) procname); } - -//======================================================================== -// Copies the specified OpenGL state categories from src to dst -//======================================================================== - -void _glfwPlatformCopyContext(_GLFWwindow* src, _GLFWwindow* dst, unsigned long mask) -{ - glXCopyContext(_glfwLibrary.X11.display, - src->GLX.context, - dst->GLX.context, - mask); -} - diff --git a/tests/sharing.c b/tests/sharing.c index 74e11478..0042a858 100644 --- a/tests/sharing.c +++ b/tests/sharing.c @@ -158,10 +158,13 @@ int main(int argc, char** argv) exit(EXIT_FAILURE); } - // Set drawing color for the first context and copy it to the second + // Set drawing color for both contexts glfwMakeContextCurrent(windows[0]); glColor3f(0.6f, 0.f, 0.6f); - glfwCopyContext(windows[0], windows[1], GL_CURRENT_BIT); + glfwMakeContextCurrent(windows[1]); + glColor3f(0.6f, 0.6f, 0.f); + + glfwMakeContextCurrent(windows[0]); while (!closed) {