Added _GLFW_REQUIRE* to user context functions.

This commit is contained in:
Doug Binks 2020-07-15 11:19:18 +01:00
parent 4caca8b20c
commit a1a1b77150

View File

@ -763,6 +763,8 @@ GLFWAPI GLFWusercontext* glfwCreateUserContext(GLFWwindow* handle)
_GLFWusercontext* context;
_GLFWwindow* window = (_GLFWwindow*)handle;
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
context = _glfwPlatformCreateUserContext(window);
return (GLFWusercontext*)context;
@ -771,6 +773,9 @@ GLFWAPI GLFWusercontext* glfwCreateUserContext(GLFWwindow* handle)
GLFWAPI void glfwDestroyUserContext(GLFWusercontext* handle)
{
_GLFWusercontext* context = (_GLFWusercontext*)handle;
_GLFW_REQUIRE_INIT();
if (context)
context->destroy(context);
}
@ -779,6 +784,8 @@ GLFWAPI void glfwMakeUserContextCurrent(GLFWusercontext* handle)
{
_GLFWusercontext* context = (_GLFWusercontext*)handle;
_GLFW_REQUIRE_INIT();
glfwMakeContextCurrent(NULL);
if (context)