소스 검색

Removed glfwCopyContext to map better against EGL.

Camilla Berglund 13 년 전
부모
커밋
2a166c5086
8개의 변경된 파일5개의 추가작업 그리고 77개의 파일을 삭제
  1. 0 7
      include/GL/glfw3.h
  2. 0 1
      readme.html
  3. 0 10
      src/cocoa_opengl.m
  4. 0 1
      src/internal.h
  5. 0 29
      src/opengl.c
  6. 0 14
      src/win32_opengl.c
  7. 0 13
      src/x11_opengl.c
  8. 5 2
      tests/sharing.c

+ 0 - 7
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

+ 0 - 1
readme.html

@@ -279,7 +279,6 @@ version of GLFW.</p>
   <li>Added <code>glfwSetWindowIconifyCallback</code> function and <code>GLFWwindowiconifyfun</code> type for receiving window iconification events</li>
   <li>Added <code>glfwGetClipboardString</code> and <code>glfwSetClipboardString</code> functions for interacting with the system clipboard</li>
   <li>Added <code>glfwGetCurrentContext</code> function for retrieving the window whose OpenGL context is current</li>
-  <li>Added <code>glfwCopyContext</code> function for copying OpenGL state categories between contexts</li>
   <li>Added <code>GLFW_CLIENT_API</code>, <code>GLFW_OPENGL_API</code> and <code>GLFW_OPENGL_ES_API</code> for selecting client API</li>
   <li>Added <code>GLFW_OPENGL_ROBUSTNESS</code> window hint and associated strategy tokens for <code>GL_ARB_robustness</code> support</li>
   <li>Added <code>GLFW_OPENGL_REVISION</code> window parameter to make up for removal of <code>glfwGetGLVersion</code></li>

+ 0 - 10
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];
-}
-

+ 0 - 1
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);
 
 
 //========================================================================

+ 0 - 29
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);
-}
-

+ 0 - 14
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");
-    }
-}
-

+ 0 - 13
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);
-}
-

+ 5 - 2
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)
     {