stw: Hack for applications which use wglSetPixelFormat instead of SetPixelFormat.

This commit is contained in:
José Fonseca 2009-02-10 11:37:23 +00:00
parent 5b0807b72f
commit 9fb9ee9d24

View file

@ -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;
}