mirror of
https://github.com/glfw/glfw.git
synced 2024-11-25 19:42:00 +00:00
Removed glfwCopyContext to map better against EGL.
This commit is contained in:
parent
06e7a96c61
commit
2a166c5086
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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];
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
||||
//========================================================================
|
||||
|
29
src/opengl.c
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);
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user