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

Roderick Colenbrander thunderbird2k at gmail.com
Wed Mar 3 03:01:02 CST 2010


On Wed, Mar 3, 2010 at 8:14 AM, Kusanagi Kouichi <slash at ac.auone-net.jp> wrote:
> 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?
>
> #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;
> }
>
>

Correct, we should not crash. I'll see if I can fix the
wglGetProcAddress part in a cleaner way.

Roderick



More information about the wine-devel mailing list