[wined3d] Converting Wined3d to use WGL instead of GLX

Aric Cyr Aric.Cyr at gmail.com
Tue Dec 13 21:53:12 CST 2005

Hello all,

As I mentinoed in a recent post, I have almost completed the GLX->WGL
conversion.  Last night I tracked down my last bug that was causing most of my
demo apps to fail.  

It seems that the problem was the conversion from glXGetProcAddress to using
wglGetProcAddress.  wined3d uses glXGetProcAddress to get the OpenGL extension
function pointers, which is what wglGetProcAddress also does.  However
wglGetProcAddress _first_ checks opengl32.dll for the extension and returns the
thunk function pointer if it exists, and only then falls back to libGL.so by
calling glXGetProcAddress.

So now I am stuck...  if I use wglGetProcAddress for OpenGL extensions I get
crashes in most D3D9 applications.  If I use glXGetProcAddress in wined3d
everything works fine, but then wined3d is still dependent on glx.

So my questions:

1) should the thunks returned from wglGetProcAddress be causing crashes at all?  
   Note that they don't crash right away, but "eventually" usually during a call 
   to glDrawArrays it seems (after a call to glSecondaryColor3fEXT).

2) what is the reason for wglGetProcAddress to check opengl32.dll before 
   libGL.so? Would the reverse logic still be a resonable solution?


More information about the wine-devel mailing list