[PATCH 2/2] d3d9/tests: Test that Direct3D restores the pixel format on the window it targets. (try 2)

Henri Verbeet hverbeet at gmail.com
Fri Feb 7 08:29:03 CST 2014


On 7 February 2014 02:13, Ken Thomases <ken at codeweavers.com> wrote:
>
> +    ZeroMemory(&present_parameters, sizeof(present_parameters));
> +    present_parameters.Windowed = TRUE;
> +    present_parameters.hDeviceWindow = hwnd;
> +    present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
> +
> +    hr = IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
> +            hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device);
> +    if (FAILED(hr) || !device)
> +    {
> +        skip("Failed to create device\n");
> +        goto cleanup;
> +    }
Please use create_device() for creating the device, unless there's
some reason it can't work here.

> +    hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
> +    ok(SUCCEEDED(hr), "Present failed %#x\n", hr);
I think an interesting test would be Present() with a non-NULL
destination window. I'd also like the equivalent test for d3d8, and
ddraw with a clip window.



More information about the wine-devel mailing list