From 44035f5ef17d30f4f383603dd299c89ff61889d6 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sun, 8 May 2011 16:29:33 +0200 Subject: [PATCH] Added error check. --- src/opengl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/opengl.c b/src/opengl.c index 2e5e287d..7621b438 100644 --- a/src/opengl.c +++ b/src/opengl.c @@ -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); }