Added error check.

This commit is contained in:
Camilla Berglund 2011-05-08 16:29:33 +02:00
parent 8aa8b7c2e4
commit 44035f5ef1

View File

@ -606,6 +606,12 @@ GLFWAPI void glfwCopyGLState(GLFWwindow hsrc, GLFWwindow hdst, unsigned long mas
src = (_GLFWwindow*) hsrc;
dst = (_GLFWwindow*) hdst;
if (_glfwLibrary.currentWindow == dst)
{
_glfwSetError(GLFW_INVALID_VALUE, "Cannot copy OpenGL state to a current context");
return;
}
_glfwPlatformCopyGLState(src, dst, mask);
}