Added glfwGetCurrentUserContext

This commit is contained in:
Doug Binks 2020-07-15 13:19:33 +01:00
parent 6539d101f3
commit f2806aa9ab
2 changed files with 12 additions and 0 deletions

View File

@ -5827,6 +5827,12 @@ GLFWAPI void glfwDestroyUserContext(GLFWusercontext* context);
*/ */
GLFWAPI void glfwMakeUserContextCurrent(GLFWusercontext* context); GLFWAPI void glfwMakeUserContextCurrent(GLFWusercontext* context);
/*! @brief Get the current OpenGL user context
*
*/
GLFWAPI GLFWusercontext* glfwGetCurrentUserContext(void);
/*! @brief Returns whether the Vulkan loader and an ICD have been found. /*! @brief Returns whether the Vulkan loader and an ICD have been found.
* *
* This function returns whether the Vulkan loader and any minimally functional * This function returns whether the Vulkan loader and any minimally functional

View File

@ -802,3 +802,9 @@ GLFWAPI void glfwMakeUserContextCurrent(GLFWusercontext* handle)
if (context) if (context)
context->makeCurrent(context); context->makeCurrent(context);
} }
GLFWAPI GLFWusercontext* glfwGetCurrentUserContext(void)
{
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
return _glfwPlatformGetTls(&_glfw.usercontextSlot);
}