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 table.
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 functions.
For the moment, I think 3) is the best. Feel free to propose other solutions :-)
Lionel
Lionel Ulmer lionel.ulmer@free.fr writes:
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 table.
The problem with that is that 'DC_GetDCPtr' is already flagged as a hack and so I am bit reluctant to use it :-)
Put all HDC function in GDI itself and replace in OpenGL's spec file all of these by forwards to GDI.
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 functions.
For the moment, I think 3) is the best. Feel free to propose other solutions :-)
I don't know, I think the current way is not so bad. It's better to export just a couple of internal things like display and drawable than a full table of functions that will be a pain to keep compatible across versions. If you really want to get rid of the escapes then I think 2) would be cleaner.
I don't know, I think the current way is not so bad. It's better to export just a couple of internal things like display and drawable than a full table of functions that will be a pain to keep compatible across versions. If you really want to get rid of the escapes then I think 2) would be cleaner.
Well, the problem with the current way is that 'display' and 'drawable' are really X11 concepts... This means that the current OpenGL code will ever only work with the X11DRV. While I agree that it's separated, it's not 'clean' (in the sense that we have X11 code elsewhere than in X11DRV itself).
The only problem with 2) is that there is one function that lacks the proper context variable (wglGetProcAddress).
Lionel
Lionel Ulmer lionel.ulmer@free.fr writes:
Well, the problem with the current way is that 'display' and 'drawable' are really X11 concepts... This means that the current OpenGL code will ever only work with the X11DRV. While I agree that it's separated, it's not 'clean' (in the sense that we have X11 code elsewhere than in X11DRV itself).
Note that the escapes will fail gracefully if x11drv is not present, so it would be perfectly possible to make the opengl dll support other drivers too. I agree it's not completely clean, and I'm certainly open to other solutions, as long as we don't introduce some major ugliness just to get rid of a minor one...