mirror of
https://github.com/glfw/glfw.git
synced 2024-11-15 10:44:34 +00:00
Added _GLFW_REQUIRE* to user context functions.
This commit is contained in:
parent
4caca8b20c
commit
a1a1b77150
@ -763,6 +763,8 @@ GLFWAPI GLFWusercontext* glfwCreateUserContext(GLFWwindow* handle)
|
|||||||
_GLFWusercontext* context;
|
_GLFWusercontext* context;
|
||||||
_GLFWwindow* window = (_GLFWwindow*)handle;
|
_GLFWwindow* window = (_GLFWwindow*)handle;
|
||||||
|
|
||||||
|
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
||||||
|
|
||||||
context = _glfwPlatformCreateUserContext(window);
|
context = _glfwPlatformCreateUserContext(window);
|
||||||
|
|
||||||
return (GLFWusercontext*)context;
|
return (GLFWusercontext*)context;
|
||||||
@ -771,6 +773,9 @@ GLFWAPI GLFWusercontext* glfwCreateUserContext(GLFWwindow* handle)
|
|||||||
GLFWAPI void glfwDestroyUserContext(GLFWusercontext* handle)
|
GLFWAPI void glfwDestroyUserContext(GLFWusercontext* handle)
|
||||||
{
|
{
|
||||||
_GLFWusercontext* context = (_GLFWusercontext*)handle;
|
_GLFWusercontext* context = (_GLFWusercontext*)handle;
|
||||||
|
|
||||||
|
_GLFW_REQUIRE_INIT();
|
||||||
|
|
||||||
if (context)
|
if (context)
|
||||||
context->destroy(context);
|
context->destroy(context);
|
||||||
}
|
}
|
||||||
@ -779,6 +784,8 @@ GLFWAPI void glfwMakeUserContextCurrent(GLFWusercontext* handle)
|
|||||||
{
|
{
|
||||||
_GLFWusercontext* context = (_GLFWusercontext*)handle;
|
_GLFWusercontext* context = (_GLFWusercontext*)handle;
|
||||||
|
|
||||||
|
_GLFW_REQUIRE_INIT();
|
||||||
|
|
||||||
glfwMakeContextCurrent(NULL);
|
glfwMakeContextCurrent(NULL);
|
||||||
|
|
||||||
if (context)
|
if (context)
|
||||||
|
Loading…
Reference in New Issue
Block a user