http://bugs.winehq.org/show_bug.cgi?id=17193
--- Comment #1 from Roderick Colenbrander thunderbird2k@gmx.net 2009-02-02 15:25:57 --- (In reply to comment #0)
Created an attachment (id=19093)
--> (http://bugs.winehq.org/attachment.cgi?id=19093) [details]
patch
Currently, WineD3D assumes wglGetExtensionsStringARB and wglGetPixelFormatAttribivARB are present, and if they're not, it will segfault when attempting to call them. This patch adds some checks so that:
- The pointers in GLINFO_LOCATION are set to NULL when a WGL function is not
present (this was only done for GL ones).
When wglGetProcAddress fails it is guaranteed to return NULL. This is opposed to glXGetProcAddress which isn't required to return NULL. Setting function pointers to NULL is explicitly done for GL extensions because in case of wine we have some evil code where 'pwglGetProcAddress' is directly forwarded to glXGetProcAddress.
- Code paths exist to fail gracefully when either wglGetExtensionsStringARB or
wglGetPixelFormatAttribivARB are unimplemented, disabling the functionality associated with them.
(This situation was found when using WineD3D with Chromium OpenGL as implemented in VirtualBox OSE 2.1)
At this point our pixel format code requires WGL_ARB_pixel_format. I could add extra code for a legacy PFD backend but I think it is better to fix Chromium because this extension is very common and basically any serious or modern OpenGL program uses it.