mirror of
https://github.com/glfw/glfw.git
synced 2025-10-04 13:46:37 +00:00
Started with single GLRC for GLXContext.
This commit is contained in:
parent
d873ed69fb
commit
68d0c63865
@ -237,8 +237,15 @@ static void destroyContextGLX(_GLFWwindow* window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (window->context.glx.handle)
|
if (window->context.glx.handle)
|
||||||
|
{
|
||||||
|
#ifdef _GLFW_OPENGL_SINGLE_GLRC
|
||||||
|
if (window->context.customctx)
|
||||||
{
|
{
|
||||||
glXDestroyContext(_glfw.x11.display, window->context.glx.handle);
|
glXDestroyContext(_glfw.x11.display, window->context.glx.handle);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
glXDestroyContext(_glfw.x11.display, window->context.glx.handle);
|
||||||
|
#endif
|
||||||
window->context.glx.handle = NULL;
|
window->context.glx.handle = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -495,6 +502,25 @@ GLFWbool _glfwCreateContextGLX(_GLFWwindow* window,
|
|||||||
|
|
||||||
_glfwGrabErrorHandlerX11();
|
_glfwGrabErrorHandlerX11();
|
||||||
|
|
||||||
|
#ifdef _GLFW_OPENGL_SINGLE_GLRC
|
||||||
|
if(share)
|
||||||
|
{
|
||||||
|
// Use shared context instead of creating a new one
|
||||||
|
window->context.wgl.handle = share;
|
||||||
|
window->context.customctx = GLFW_FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Create new GL render context
|
||||||
|
window->context.glx.handle = NULL;
|
||||||
|
window->context.customctx = GLFW_TRUE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _GLFW_OPENGL_SINGLE_GLRC
|
||||||
|
if (!window->context.glx.handle)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
if (_glfw.glx.ARB_create_context)
|
if (_glfw.glx.ARB_create_context)
|
||||||
{
|
{
|
||||||
int index = 0, mask = 0, flags = 0;
|
int index = 0, mask = 0, flags = 0;
|
||||||
@ -602,6 +628,7 @@ GLFWbool _glfwCreateContextGLX(_GLFWwindow* window,
|
|||||||
window->context.glx.handle =
|
window->context.glx.handle =
|
||||||
createLegacyContextGLX(window, native, share);
|
createLegacyContextGLX(window, native, share);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_glfwReleaseErrorHandlerX11();
|
_glfwReleaseErrorHandlerX11();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user