Skip to content

Commit

Permalink
Move more context logic out of glfwCreateWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
elmindreda committed Feb 6, 2018
1 parent 9bfa499 commit c29e445
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 10 additions & 0 deletions src/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 0 additions & 10 deletions src/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c29e445

Please sign in to comment.