wined3d: Don't crash when opengl is not available.

Kusanagi Kouichi slash at ac.auone-net.jp
Wed Mar 3 01:14:43 CST 2010


On 2010-03-02 18:06:00 +0100, Roderick Colenbrander wrote:
> In what situation does it exactly crash for you? Is it crashing
> because there is no libGL around? I'm not sure what the right thing to
> do is. Due to it our wglGetProcAddress won't function because it
> relies on glXGetProcAddress.
> 
> Our use of wglGetProcAddress isn't correct (but it works on WINE :))
> in the sense that officially an OpenGL context must be around. Perhaps
> I should fix this behavior in gdi32 and in wined3d. It would allow for
> a nicer fix than adjusting the USE_GL_FUNC macro.
> 
> I'm not sure about the shader backend part of the patch (I don't know
> that code well), so I'm leaving that to Henri and Stefan.
> 
> Roderick
> 

The attached code crashes if libGL is not installed. It doesn't crash
if installed.
I don't expect wined3d works without opengl. But it shouldn't crash,
should it?
-------------- next part --------------
#include <windows.h>
#include <ddraw.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
		   LPSTR CmdLine, int CmdShow)
{
    LPDIRECTDRAW dd;

    if (DirectDrawCreate(NULL, &dd, NULL) == DD_OK)
	IDirectDraw_Release(dd);

    return 0;
}


More information about the wine-devel mailing list