On 27 February 2014 02:46, Francois Gouget fgouget@codeweavers.com wrote:
Is there a way to check what surface types are supported?
In theory, but in practice the most reliable way seems to be calling CreateSurface() and seeing if it works.
Unfortunately the correct way to fix these depends a bit on the specific case. E.g.:
@@ -4817,6 +4819,8 @@ static void test_set_surface_desc(void)
hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr);
if (FAILED(hr))
goto done;
hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface3, (void **)&surface3); ok(SUCCEEDED(hr), "Failed to get IDirectDrawSurface3 interface, hr %#x.\n", hr);
@@ -5113,6 +5117,12 @@ static void test_user_memory_getdc(void) ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr);
if (FAILED(hr))
{
IDirectDraw2_Release(ddraw);
DestroyWindow(window);
return;
}
hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface3, (void **)&surface3); ok(SUCCEEDED(hr), "Failed to get IDirectDrawSurface3 interface, hr %#x.\n", hr);
These can be fixed by adding DDSCAPS_OFFSCREENPLAIN to ddsd.ddsCaps.dwCaps.