diff --git a/src/context.c b/src/context.c index 4c866fa9..fd344cf1 100644 --- a/src/context.c +++ b/src/context.c @@ -46,6 +46,16 @@ // GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig) { + if (ctxconfig->share) + { + if (ctxconfig->client == GLFW_NO_API || + ctxconfig->share->context.client == GLFW_NO_API) + { + _glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL); + return GLFW_FALSE; + } + } + if (ctxconfig->source != GLFW_NATIVE_CONTEXT_API && ctxconfig->source != GLFW_EGL_CONTEXT_API && ctxconfig->source != GLFW_OSMESA_CONTEXT_API) diff --git a/src/window.c b/src/window.c index afdc4fcb..44c2c241 100644 --- a/src/window.c +++ b/src/window.c @@ -182,16 +182,6 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, wndconfig.title = title; ctxconfig.share = (_GLFWwindow*) share; - if (ctxconfig.share) - { - if (ctxconfig.client == GLFW_NO_API || - ctxconfig.share->context.client == GLFW_NO_API) - { - _glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL); - return NULL; - } - } - if (!_glfwIsValidContextConfig(&ctxconfig)) return NULL;