aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2009-03-20 13:05:51 +0100
committerMichal Krol <[email protected]>2009-03-20 13:05:51 +0100
commit4489f9efee58f2cba374298f2d43c96e5cd2ff41 (patch)
treedf078f476ce7aab2f0e46dba5b8938c69314a4c9 /src/gallium/state_trackers/wgl/shared/stw_pixelformat.c
parent3d4246e22e90ffef5fe0cd935bd54c7f862e82f7 (diff)
stw: Keep per-thread storage for current context and pixel format.
Diffstat (limited to 'src/gallium/state_trackers/wgl/shared/stw_pixelformat.c')
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_pixelformat.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c b/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c
index 2992a1ac0a1..b216ca5c823 100644
--- a/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c
+++ b/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c
@@ -28,6 +28,7 @@
#include "util/u_debug.h"
#include "stw_pixelformat.h"
#include "stw_public.h"
+#include "stw_tls.h"
#define MAX_PIXELFORMATS 16
@@ -35,8 +36,6 @@ static struct pixelformat_info pixelformats[MAX_PIXELFORMATS];
static uint pixelformat_count = 0;
static uint pixelformat_extended_count = 0;
-static uint currentpixelformat = 0;
-
static void
add_standard_pixelformats(
@@ -248,7 +247,7 @@ int
stw_pixelformat_get(
HDC hdc )
{
- return currentpixelformat;
+ return stw_tls_get_data()->currentPixelFormat;
}
@@ -267,8 +266,8 @@ stw_pixelformat_set(
if (index >= count)
return FALSE;
- currentpixelformat = iPixelFormat;
-
+ stw_tls_get_data()->currentPixelFormat = iPixelFormat;
+
/* Some applications mistakenly use the undocumented wglSetPixelFormat
* function instead of SetPixelFormat, so we call SetPixelFormat here to
* avoid opengl32.dll's wglCreateContext to fail */