Add internal TLS support

Related to #970.
This commit is contained in:
Camilla Löwy
2017-03-08 13:58:09 +01:00
parent 62414bff6e
commit aaf2800c9c
19 changed files with 109 additions and 116 deletions
+4 -4
View File
@@ -233,12 +233,12 @@ static void makeContextCurrentWGL(_GLFWwindow* window)
if (window)
{
if (wglMakeCurrent(window->context.wgl.dc, window->context.wgl.handle))
_glfwPlatformSetCurrentContext(window);
_glfwPlatformSetTls(&_glfw.context, window);
else
{
_glfwInputErrorWin32(GLFW_PLATFORM_ERROR,
"WGL: Failed to make context current");
_glfwPlatformSetCurrentContext(NULL);
_glfwPlatformSetTls(&_glfw.context, NULL);
}
}
else
@@ -249,7 +249,7 @@ static void makeContextCurrentWGL(_GLFWwindow* window)
"WGL: Failed to clear current context");
}
_glfwPlatformSetCurrentContext(NULL);
_glfwPlatformSetTls(&_glfw.context, NULL);
}
}
@@ -268,7 +268,7 @@ static void swapBuffersWGL(_GLFWwindow* window)
static void swapIntervalWGL(int interval)
{
_GLFWwindow* window = _glfwPlatformGetCurrentContext();
_GLFWwindow* window = _glfwPlatformGetTls(&_glfw.context);
window->context.wgl.interval = interval;