Skip to content
Snippets Groups Projects
Commit 68414af8 authored by sdegrande's avatar sdegrande
Browse files

Add a glfwGetGLXFBConfig() function.

This is needed with OpenXR, to create the binding with the graphics
platform.

An issue is open about that need:
https://github.com/glfw/glfw/issues/2129
parent 1a3060e6
Branches
No related tags found
No related merge requests found
......@@ -478,6 +478,21 @@ GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);
* @ingroup native
*/
GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow* window);
/*! @brief Returns the `GLXFBConfig` that was chosen to create the
* specified window.
*
* @return The `GLXFBConfig` that was chosen to create the specified
* window, or `NULL` if an [error](@ref error_handling) occurred.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.4
*
* @ingroup native
*/
GLFWAPI GLXFBConfig glfwGetGLXFBConfig(GLFWwindow* window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_WAYLAND)
......
......@@ -246,6 +246,11 @@ static void destroyContextGLX(_GLFWwindow* window)
glXDestroyContext(_glfw.x11.display, window->context.glx.handle);
window->context.glx.handle = NULL;
}
if (window->context.glx.fbconfig)
{
window->context.glx.fbconfig = NULL;
}
}
......@@ -788,5 +793,18 @@ GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow* handle)
return window->context.glx.window;
}
#endif // _GLFW_X11
GLFWAPI GLXFBConfig glfwGetGLXFBConfig(GLFWwindow* handle)
{
_GLFWwindow* window = (_GLFWwindow*) handle;
_GLFW_REQUIRE_INIT_OR_RETURN(None);
if (window->context.client == GLFW_NO_API)
{
_glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL);
return NULL;
}
return window->context.glx.fbconfig;
}
#endif // _GLFW_X11
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment