Hi all,
To make NWN's model viewer work in Wine, I did the attached patch... Warning, it's not for the faint of heart so ugly it is :-)
Basically, the plan is to have two drawable per DC in the X11 driver, one for 'normal' drawings, the other for OpenGL drawings, the latter being the one associated with the window when goind a CLIPSIBLINGS GetDCEx.
Now to do this 'nicely', the 'use ExtEscape to store data' method is not the right one (but it works :-) ).
So my current plan is to really separate all the X11 stuff into the X11DRV and to have a 'portable' opengl32.dll library. Now my question is 'how to do this properly' ? Is extending the 'dc' function pointer array with all the needed OpenGL functions a way (even if these functions are NOT GDI functions but pure OpenGL) ? The problem with this solution is that I would need to use the 'DC_GetDCPtr' function outside of GDI (and that may break DLL separation).
Another solution could be to add all the OpenGL functions as GDI functions, do the DC function pointer thing and then put a forward from all the wgl functions to the GDI32.* functions.
What do you all think of it ?
Lionel