Commit 9ae22f1a authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

d3d9: Do not fail if d3d9 is not available.

parent 573db35b
......@@ -739,7 +739,7 @@ static void test_reset(void)
if(FAILED(hr))
{
trace("could not create device, IDirect3D9_CreateDevice returned %#x\n", hr);
skip("could not create device, IDirect3D9_CreateDevice returned %#x\n", hr);
goto cleanup;
}
......@@ -975,8 +975,12 @@ static void test_scene(void)
hr = IDirect3D9_CreateDevice( pD3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL /* no NULLREF here */, hwnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &pDevice );
ok(hr == D3D_OK, "IDirect3D9_CreateDevice failed with %s\n", DXGetErrorString9(hr));
if(!pDevice) goto cleanup;
ok(hr == D3D_OK || hr == D3DERR_NOTAVAILABLE, "IDirect3D9_CreateDevice failed with %s\n", DXGetErrorString9(hr));
if(!pDevice)
{
skip("Failed to create a d3d device\n");
goto cleanup;
}
/* Get the caps, they will be needed to tell if an operation is supposed to be valid */
memset(&caps, 0, sizeof(caps));
......@@ -1124,8 +1128,12 @@ static void test_limits(void)
hr = IDirect3D9_CreateDevice( pD3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL /* no NULLREF here */, hwnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &pDevice );
ok(hr == D3D_OK, "IDirect3D9_CreateDevice failed with %s\n", DXGetErrorString9(hr));
if(!pDevice) goto cleanup;
ok(hr == D3D_OK || hr == D3DERR_NOTAVAILABLE, "IDirect3D9_CreateDevice failed with %s\n", DXGetErrorString9(hr));
if(!pDevice)
{
skip("Failed to create a d3d device\n");
goto cleanup;
}
hr = IDirect3DDevice9_CreateTexture(pDevice, 16, 16, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &pTexture, NULL);
ok(hr == D3D_OK, "IDirect3DDevice9_CreateTexture failed with %s\n", DXGetErrorString9(hr));
......@@ -1187,8 +1195,12 @@ static void test_depthstenciltest(void)
hr = IDirect3D9_CreateDevice( pD3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL /* no NULLREF here */, hwnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &pDevice );
ok(hr == D3D_OK, "IDirect3D9_CreateDevice failed with %s\n", DXGetErrorString9(hr));
if(!pDevice) goto cleanup;
ok(hr == D3D_OK || hr == D3DERR_NOTAVAILABLE, "IDirect3D9_CreateDevice failed with %s\n", DXGetErrorString9(hr));
if(!pDevice)
{
skip("Failed to create a d3d device\n");
goto cleanup;
}
hr = IDirect3DDevice9_GetDepthStencilSurface(pDevice, &pDepthStencil);
ok(hr == D3D_OK && pDepthStencil != NULL, "IDirect3DDevice9_GetDepthStencilSurface failed with %s\n", DXGetErrorString9(hr));
......
......@@ -96,8 +96,12 @@ static void test_query_support(IDirect3D9 *pD3d, HWND hwnd)
hr = IDirect3D9_CreateDevice( pD3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &pDevice );
ok(SUCCEEDED(hr), "Failed to create IDirect3D9Device (%s)\n", DXGetErrorString9(hr));
if (FAILED(hr)) goto cleanup;
ok(SUCCEEDED(hr) || hr == D3DERR_NOTAVAILABLE, "Failed to create IDirect3D9Device (%s)\n", DXGetErrorString9(hr));
if (FAILED(hr))
{
skip("Failed to create a d3d device\n");
goto cleanup;
}
for(i = 0; i < sizeof(queries) / sizeof(queries[0]); i++)
{
......
......@@ -58,7 +58,7 @@ static IDirect3DDevice9 *init_d3d9(void)
if(FAILED(hres))
{
trace("could not create device, IDirect3D9_CreateDevice returned %#x\n", hres);
skip("could not create device, IDirect3D9_CreateDevice returned %#x\n", hres);
return NULL;
}
......
......@@ -57,7 +57,7 @@ static IDirect3DDevice9 *init_d3d9(HMODULE d3d9_handle)
if(FAILED(hr))
{
trace("could not create device, IDirect3D9_CreateDevice returned %#x\n", hr);
skip("could not create device, IDirect3D9_CreateDevice returned %#x\n", hr);
return NULL;
}
......
......@@ -56,7 +56,7 @@ static IDirect3DDevice9 *init_d3d9(HMODULE d3d9_handle)
if(FAILED(hr))
{
trace("could not create device, IDirect3D9_CreateDevice returned %#x\n", hr);
skip("could not create device, IDirect3D9_CreateDevice returned %#x\n", hr);
return NULL;
}
......
......@@ -120,7 +120,7 @@ static IDirect3DDevice9 *init_d3d9(void)
present_parameters.AutoDepthStencilFormat = D3DFMT_D16;
hr = IDirect3D9_CreateDevice(d3d9_ptr, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, present_parameters.hDeviceWindow, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device_ptr);
ok(hr == D3D_OK, "IDirect3D_CreateDevice returned: %s\n", DXGetErrorString9(hr));
ok(hr == D3D_OK || hr == D3DERR_NOTAVAILABLE, "IDirect3D_CreateDevice returned: %s\n", DXGetErrorString9(hr));
return device_ptr;
}
......@@ -1199,7 +1199,11 @@ START_TEST(visual)
}
device_ptr = init_d3d9();
if (!device_ptr) return;
if (!device_ptr)
{
skip("Creating the device failed\n");
return;
}
IDirect3DDevice9_GetDeviceCaps(device_ptr, &caps);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment