summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-02-10 11:37:23 +0000
committerJosé Fonseca <jfonseca@vmware.com>2009-02-10 11:51:47 +0000
commit9fb9ee9d241c99a76e15af2db328332dfecf586d (patch)
treeeb2d1245ff0cf8c0dbd5b927083013eb13040dc8 /src
parent5b0807b72f16a4835e4b28aa8a66e9bcd867d383 (diff)
downloadexternal_mesa3d-9fb9ee9d241c99a76e15af2db328332dfecf586d.zip
external_mesa3d-9fb9ee9d241c99a76e15af2db328332dfecf586d.tar.gz
external_mesa3d-9fb9ee9d241c99a76e15af2db328332dfecf586d.tar.bz2
stw: Hack for applications which use wglSetPixelFormat instead of SetPixelFormat.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_pixelformat.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c b/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c
index 12b5ac6..84b7b28 100644
--- a/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c
+++ b/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c
@@ -256,6 +256,14 @@ stw_pixelformat_set(
return FALSE;
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 */
+ if (GetPixelFormat(hdc) == 0) {
+ SetPixelFormat(hdc, iPixelFormat, NULL);
+ }
+
return TRUE;
}