d3drm: Implement IDirect3DRMDevice*::GetDirect3DDevice.
This commit is contained in:
parent
1075d71135
commit
0041c56004
|
@ -1273,7 +1273,15 @@ static D3DRMTEXTUREQUALITY WINAPI d3drm_device3_GetTextureQuality(IDirect3DRMDev
|
|||
|
||||
static HRESULT WINAPI d3drm_device3_GetDirect3DDevice(IDirect3DRMDevice3 *iface, IDirect3DDevice **d3d_device)
|
||||
{
|
||||
FIXME("iface %p, d3d_device %p stub!\n", iface, d3d_device);
|
||||
struct d3drm_device *device = impl_from_IDirect3DRMDevice3(iface);
|
||||
TRACE("iface %p, d3d_device %p!\n", iface, d3d_device);
|
||||
|
||||
if (device->device)
|
||||
{
|
||||
*d3d_device = device->device;
|
||||
IDirect3DDevice_AddRef(*d3d_device);
|
||||
return D3DRM_OK;
|
||||
}
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
|
|
@ -2012,9 +2012,7 @@ static void test_create_device_from_clipper1(void)
|
|||
|
||||
/* Fetch immediate mode device in order to access render target */
|
||||
hr = IDirect3DRMDevice_GetDirect3DDevice(device1, &d3ddevice1);
|
||||
todo_wine ok(hr == D3DRM_OK, "Cannot get IDirect3DDevice interface (hr = %x).\n", hr);
|
||||
if (FAILED(hr))
|
||||
goto cleanup;
|
||||
ok(hr == D3DRM_OK, "Cannot get IDirect3DDevice interface (hr = %x).\n", hr);
|
||||
|
||||
hr = IDirect3DDevice_QueryInterface(d3ddevice1, &IID_IDirectDrawSurface, (void **)&surface);
|
||||
ok(hr == DD_OK, "Cannot get surface to the render target (hr = %x).\n", hr);
|
||||
|
@ -2088,7 +2086,7 @@ static void test_create_device_from_clipper1(void)
|
|||
ref2 = get_refcount((IUnknown *)d3drm1);
|
||||
ok(ref1 == ref2, "expected ref1 == ref2, got ref1 = %u, ref2 = %u.\n", ref1, ref2);
|
||||
cref2 = get_refcount((IUnknown *)clipper);
|
||||
todo_wine ok(cref1 == cref2, "expected cref1 == cref2, got cref1 = %u, cref2 = %u.\n", cref1, cref2);
|
||||
ok(cref1 == cref2, "expected cref1 == cref2, got cref1 = %u, cref2 = %u.\n", cref1, cref2);
|
||||
|
||||
/* Test if render target format follows the screen format */
|
||||
hr = IDirectDraw_GetDisplayMode(ddraw, &desc);
|
||||
|
@ -2104,9 +2102,7 @@ static void test_create_device_from_clipper1(void)
|
|||
ok(hr == D3DRM_OK, "Cannot create IDirect3DRMDevice interface (hr = %x).\n", hr);
|
||||
|
||||
hr = IDirect3DRMDevice_GetDirect3DDevice(device1, &d3ddevice1);
|
||||
todo_wine ok(hr == D3DRM_OK, "Cannot get IDirect3DDevice interface (hr = %x).\n", hr);
|
||||
if (FAILED(hr))
|
||||
goto cleanup;
|
||||
ok(hr == D3DRM_OK, "Cannot get IDirect3DDevice interface (hr = %x).\n", hr);
|
||||
|
||||
hr = IDirect3DDevice_QueryInterface(d3ddevice1, &IID_IDirectDrawSurface, (void **)&surface);
|
||||
ok(hr == DD_OK, "Cannot get surface to the render target (hr = %x).\n", hr);
|
||||
|
@ -2120,19 +2116,13 @@ static void test_create_device_from_clipper1(void)
|
|||
hr = IDirectDraw2_RestoreDisplayMode(ddraw);
|
||||
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
||||
|
||||
cleanup:
|
||||
if (ds)
|
||||
IDirectDrawSurface_Release(ds);
|
||||
if (surface)
|
||||
IDirectDrawSurface_Release(surface);
|
||||
if (d3ddevice1)
|
||||
IDirect3DDevice_Release(d3ddevice1);
|
||||
IDirect3DRMDevice_Release(device1);
|
||||
if (d3drm1)
|
||||
IDirect3DRM_Release(d3drm1);
|
||||
if (clipper)
|
||||
IDirectDrawClipper_Release(clipper);
|
||||
if (ddraw)
|
||||
IDirectDraw_Release(ddraw);
|
||||
DestroyWindow(window);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue