Route WGL context code through gdi32.dll [resubmit]

Roderick Colenbrander thunderbird2k at
Wed Sep 27 15:59:53 CDT 2006


This is the first patch in a series of patches which will change the routing of wgl OpenGL calls.

Before my opengl32 rewrite all the wgl functions were inside opengl32.dll. I have moved (allmost) all wgl code over to winex11.drv. The old wgl code used ExtEscape hacks to access X datatypes. Because I just moved the code over to winex11.drv the current code still uses these hacks.

These hacks shouldn't be needed inside x11drv but getting rid of those takes some work. The X information which is needed by the wgl calls in stored in a 'PhysDev' structure which is basicly the driver equivalent of a 'hDC'. Right now the wgl functions receive a hDC but converting it to a PhysDev is done inside gdi32.dll. In order for wgl functions to get access to a physdev the functions need to be routed through gdi32 to winex11.drv

This patch routes wglCreateContext/wglMakeCurrent through gdi32.dll. For this I have added a new file opengl.c which does the routing. I have added the right prototypes to the code which loads functions from the display driver and I have changed the routing in opengl32's spec file.

Note that right now the following happens a few times for two of the WGL extension functions: opengl32 -> x11drv.foobar{ gdi32->foobar -> x11drv.foobar } So some code inside winex11.drv calls a GDI32 function to call another function inside winex11.drv. This is not nice but will be removed in a later step. Rewriting this function takes some more work and increases the size of the patch a lot. I plan to do this after most code has been moved.

Roderick Colenbrander

Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wgl_gdi_context.patch
Type: text/x-diff
Size: 10127 bytes
Desc: not available
Url :

More information about the wine-patches mailing list