On 9 December 2011 12:54, Stefan Dösinger <stefan(a)codeweavers.com> wrote:
> + Â Â d3d = pDirect3DCreate8(D3D_SDK_VERSION);
> + Â Â ok(d3d != NULL, "Direct3DCreate8 failed.\n");
> + Â Â hwnd = CreateWindow("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW, 100, 100, 160, 160, NULL, NULL, NULL, NULL);
> + Â Â ok(hwnd != NULL, "CreateWindow failed.\n");
> + Â Â if (!d3d || !hwnd)
> + Â Â Â Â goto cleanup;
> +
> + Â Â IDirect3D8_GetAdapterDisplayMode(d3d, D3DADAPTER_DEFAULT, &d3ddm);
> + Â Â ZeroMemory(&d3dpp, sizeof(d3dpp));
> + Â Â d3dpp.Windowed = TRUE;
> + Â Â d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
> + Â Â d3dpp.BackBufferWidth = 800;
> + Â Â d3dpp.BackBufferHeight = 600;
> + Â Â d3dpp.BackBufferFormat = d3ddm.Format;
> + Â Â d3dpp.EnableAutoDepthStencil = TRUE;
> + Â Â d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8;
> +
> + Â Â hr = IDirect3D8_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd,
> + Â Â Â Â Â Â D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device);
> + Â Â ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL || broken(hr == D3DERR_NOTAVAILABLE),
> + Â Â Â Â Â Â "CreateDevice failed, hr %#x.\n", hr);
> + Â Â if (!device)
> + Â Â {
> + Â Â Â Â skip("Could not create device, IDirect3D8_CreateDevice returned %#x.\n", hr);
> + Â Â Â Â goto cleanup;
> + Â Â }
> +
Copy / paste is bad for you. It looks like you're trying to create a
device. Would you like to use create_device() instead?