OpenGL: fix wglMakeCurrent bug
thunderbird2k at gmx.net
Sat Oct 7 13:08:26 CDT 2006
The opengl32 function wglMakeCurrent is routed through gdi32.dll to the display driver. One of the parameters of wglMakeCurrent is a hDC. Inside gdi32 this hDC is used to get access to the display driver. In case of wglMakeCurrent this hDC can be NULL in case the other parameter (hglrc) is NULL. When the hDC is NULL, the driver can't be accessed. Right now this case is broken.
Further in upcoming patches other functions which don't have a hDC will be routed through gdi32.dll. This patch creates a global device context which can be used in such cases.
In case of wglMakeCurrent this global device context is used when hglrc is NULL. This is fine as the wglMakeCurrent function doesn't perform any operations on the hDC and it is also specified like this in the opengl docs. The end result of the patch is that wglMakeCurrent(NULL, NULL) will work again.
GMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist!
NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1782 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20061007/87d95504/wgl_makecurrent_fix.bin
More information about the wine-patches