[RFC] Better OpenGL separation

Lionel Ulmer lionel.ulmer at free.fr
Sun Nov 10 03:57:53 CST 2002

Hi all,

The current OpenGL code (well, to be more precise, the current WGL code) is
really X11 dependant and is only separated through hacks via ExtEscape
mechanisms to get X11 specific variables.

As I never was able to find documentation about the OpenGL ICD mechanism (ie
the way all this is handled in real Windows), I see three possible solutions :

 1) As almost all WGL functions have an HDC or OpenGL context argument (for
    those having a context argument, the corresponding HDC can easily be
    found). Thus one solution would be to use 'DC_GetDCPtr' to get the DC
    pointer and then move all these functions in the GDI function pointer

    The problem with that is that 'DC_GetDCPtr' is already flagged as a hack
    and so I am bit reluctant to use it :-)
 2) Put all HDC function in GDI itself and replace in OpenGL's spec file all
    of these by forwards to GDI.

 3) Use the ExtEscape mechanism to not only get specific variables, but
    something akin to what DDraw does to get the HAL function pointer table
    and then use these pointers to do the real low level work in the WGL

For the moment, I think 3) is the best. Feel free to propose other solutions


		 Lionel Ulmer - http://www.bbrox.org/

More information about the wine-devel mailing list