From 9fb9ee9d241c99a76e15af2db328332dfecf586d Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 10 Feb 2009 11:37:23 +0000 Subject: stw: Hack for applications which use wglSetPixelFormat instead of SetPixelFormat. --- src/gallium/state_trackers/wgl/shared/stw_pixelformat.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gallium/state_trackers/wgl/shared/stw_pixelformat.c') diff --git a/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c b/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c index 12b5ac6d91..84b7b287b9 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; } -- cgit v1.2.3