diff options
author | Michal Krol <michal@vmware.com> | 2009-03-20 13:05:51 +0100 |
---|---|---|
committer | Michal Krol <michal@vmware.com> | 2009-03-20 13:05:51 +0100 |
commit | 4489f9efee58f2cba374298f2d43c96e5cd2ff41 (patch) | |
tree | df078f476ce7aab2f0e46dba5b8938c69314a4c9 /src/gallium/state_trackers/wgl/shared/stw_context.c | |
parent | 3d4246e22e90ffef5fe0cd935bd54c7f862e82f7 (diff) |
stw: Keep per-thread storage for current context and pixel format.
Diffstat (limited to 'src/gallium/state_trackers/wgl/shared/stw_context.c')
-rw-r--r-- | src/gallium/state_trackers/wgl/shared/stw_context.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gallium/state_trackers/wgl/shared/stw_context.c b/src/gallium/state_trackers/wgl/shared/stw_context.c index d77daac39c..69f25d6187 100644 --- a/src/gallium/state_trackers/wgl/shared/stw_context.c +++ b/src/gallium/state_trackers/wgl/shared/stw_context.c @@ -39,9 +39,7 @@ #include "shared/stw_pixelformat.h" #include "stw_public.h" #include "stw_context.h" - -static HDC current_hdc = NULL; -static UINT_PTR current_hglrc = 0; +#include "stw_tls.h" BOOL stw_copy_context( @@ -264,13 +262,13 @@ get_window_size( HDC hdc, GLuint *width, GLuint *height ) UINT_PTR stw_get_current_context( void ) { - return current_hglrc; + return stw_tls_get_data()->currentGLRC; } HDC stw_get_current_dc( void ) { - return current_hdc; + return stw_tls_get_data()->currentDC; } BOOL @@ -295,8 +293,8 @@ stw_make_current( if (ctx == NULL) return FALSE; - current_hdc = hdc; - current_hglrc = hglrc; + stw_tls_get_data()->currentDC = hdc; + stw_tls_get_data()->currentGLRC = hglrc; if (glcurctx != NULL) { curctx = (struct stw_context *) glcurctx->DriverCtx; |