From c29e4455bb612890561a4cc066d620d8628761a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Sun, 4 Feb 2018 16:31:40 +0100 Subject: [PATCH] Move more context logic out of glfwCreateWindow --- src/context.c | 10 ++++++++++ src/window.c | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) 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;