Am 11.06.2015 um 13:51 schrieb Aaryaman Vasishta jem456.vasishta@gmail.com:
- hr = IDirect3DDevice2_GetRenderTarget(d3ddevice2, &surface);
- ok(hr == DD_OK, "Cannot get surface to the render target (hr = %x)\n", hr);
- if (FAILED(hr))
goto cleanup;
- /* Check properties of primary and depth surfaces */
- memset(&desc, 0, sizeof(desc));
- desc.dwSize = sizeof(desc);
- hr = IDirectDrawSurface_GetSurfaceDesc(surface, &desc);
- ok(hr == DD_OK, "Cannot get surface desc structure (hr = %x)\n", hr);
- if (FAILED(hr))
goto cleanup;
Checking the surface desc isn't really relevant here. The interesting check is if the render target returned by GetRenderTarget is the surface you passed to CreateDeviceFromSurface.
Please add a test that shows that an error is returned if the surface was created without 3DDEVICE.
- hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &ds);
- ok(hr == DD_OK, "Cannot get attached depth surface (hr = %x)\n", hr);
- if (FAILED(hr))
goto cleanup;
What happens if you attach a depth surface yourself before calling CreateDeviceFromSurface? Does d3drm replace it?
- hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface7, (void**)&surface7);
- ok(hr == DD_OK, "Cannot get IDirectDrawSurface7 interface (hr = %x)\n", hr);
- IDirectDrawSurface_Release(ds);
- IDirectDrawSurface_Release(surface);
- IDirectDrawSurface7_Release(surface7);
The QueryInterface call here is redundant.