ddraw/tests: Skip tests if we can't create a primary surface.
This commit is contained in:
parent
21bc015db3
commit
ebb31dbbb7
|
@ -2748,6 +2748,22 @@ static void SurfaceCapsTest(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL can_create_primary_surface(void)
|
||||||
|
{
|
||||||
|
DDSURFACEDESC ddsd;
|
||||||
|
IDirectDrawSurface *surface;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
memset(&ddsd, 0, sizeof(ddsd));
|
||||||
|
ddsd.dwSize = sizeof(ddsd);
|
||||||
|
ddsd.dwFlags = DDSD_CAPS;
|
||||||
|
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
|
||||||
|
hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface, NULL);
|
||||||
|
if(FAILED(hr)) return FALSE;
|
||||||
|
IDirectDrawSurface_Release(surface);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(dsurface)
|
START_TEST(dsurface)
|
||||||
{
|
{
|
||||||
HRESULT ret;
|
HRESULT ret;
|
||||||
|
@ -2765,6 +2781,12 @@ START_TEST(dsurface)
|
||||||
}
|
}
|
||||||
IDirectDraw_Release(dd4);
|
IDirectDraw_Release(dd4);
|
||||||
|
|
||||||
|
if(!can_create_primary_surface())
|
||||||
|
{
|
||||||
|
skip("Unable to create primary surface\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
MipMapCreationTest();
|
MipMapCreationTest();
|
||||||
SrcColorKey32BlitTest();
|
SrcColorKey32BlitTest();
|
||||||
QueryInterface();
|
QueryInterface();
|
||||||
|
|
|
@ -89,8 +89,7 @@ static BOOL createObjects(void)
|
||||||
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE;
|
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE;
|
||||||
ddsd.dwBackBufferCount = 1;
|
ddsd.dwBackBufferCount = 1;
|
||||||
hr = IDirectDraw7_CreateSurface(DirectDraw, &ddsd, &Surface, NULL);
|
hr = IDirectDraw7_CreateSurface(DirectDraw, &ddsd, &Surface, NULL);
|
||||||
ok(hr==DD_OK, "CreateSurface returned: %08x\n", hr);
|
if(FAILED(hr)) goto err;
|
||||||
if(!Surface) goto err;
|
|
||||||
|
|
||||||
hr = IDirect3D7_CreateDevice(Direct3D, &IID_IDirect3DTnLHalDevice, Surface, &Direct3DDevice);
|
hr = IDirect3D7_CreateDevice(Direct3D, &IID_IDirect3DTnLHalDevice, Surface, &Direct3DDevice);
|
||||||
if(FAILED(hr))
|
if(FAILED(hr))
|
||||||
|
|
Loading…
Reference in New Issue