mirror of
https://github.com/glfw/glfw.git
synced 2024-11-25 22:14:34 +00:00
Move more context logic out of glfwCreateWindow
This commit is contained in:
parent
9bfa499d94
commit
c29e4455bb
@ -46,6 +46,16 @@
|
|||||||
//
|
//
|
||||||
GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
|
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 &&
|
if (ctxconfig->source != GLFW_NATIVE_CONTEXT_API &&
|
||||||
ctxconfig->source != GLFW_EGL_CONTEXT_API &&
|
ctxconfig->source != GLFW_EGL_CONTEXT_API &&
|
||||||
ctxconfig->source != GLFW_OSMESA_CONTEXT_API)
|
ctxconfig->source != GLFW_OSMESA_CONTEXT_API)
|
||||||
|
10
src/window.c
10
src/window.c
@ -182,16 +182,6 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
|
|||||||
wndconfig.title = title;
|
wndconfig.title = title;
|
||||||
ctxconfig.share = (_GLFWwindow*) share;
|
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))
|
if (!_glfwIsValidContextConfig(&ctxconfig))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user