d3d9/tests: Test creating and rendering to a swapchain on the desktop window.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3ff08662c9
commit
6bca414844
|
@ -25790,6 +25790,50 @@ static void test_nrm_instruction(void)
|
||||||
DestroyWindow(window);
|
DestroyWindow(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_desktop_window(void)
|
||||||
|
{
|
||||||
|
IDirect3DDevice9 *device;
|
||||||
|
IDirect3D9 *d3d;
|
||||||
|
D3DCOLOR color;
|
||||||
|
ULONG refcount;
|
||||||
|
HWND window;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
window = create_window();
|
||||||
|
d3d = Direct3DCreate9(D3D_SDK_VERSION);
|
||||||
|
ok(!!d3d, "Failed to create a D3D object.\n");
|
||||||
|
if (!(device = create_device(d3d, window, window, TRUE)))
|
||||||
|
{
|
||||||
|
skip("Failed to create a D3D device, skipping tests.\n");
|
||||||
|
IDirect3D9_Release(d3d);
|
||||||
|
DestroyWindow(window);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
IDirect3DDevice9_Release(device);
|
||||||
|
DestroyWindow(window);
|
||||||
|
|
||||||
|
device = create_device(d3d, GetDesktopWindow(), GetDesktopWindow(), TRUE);
|
||||||
|
todo_wine ok(!!device, "Failed to create a D3D device.\n");
|
||||||
|
if (!device)
|
||||||
|
{
|
||||||
|
IDirect3D9_Release(d3d);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 1.0f, 0);
|
||||||
|
ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr);
|
||||||
|
color = getPixelColor(device, 1, 1);
|
||||||
|
ok(color == 0x00ff0000, "Got unexpected color 0x%08x.\n", color);
|
||||||
|
|
||||||
|
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
||||||
|
ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
refcount = IDirect3DDevice9_Release(device);
|
||||||
|
ok(!refcount, "Device has %u references left.\n", refcount);
|
||||||
|
|
||||||
|
IDirect3D9_Release(d3d);
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(visual)
|
START_TEST(visual)
|
||||||
{
|
{
|
||||||
D3DADAPTER_IDENTIFIER9 identifier;
|
D3DADAPTER_IDENTIFIER9 identifier;
|
||||||
|
@ -25932,4 +25976,5 @@ START_TEST(visual)
|
||||||
test_color_vertex();
|
test_color_vertex();
|
||||||
test_sysmem_draw();
|
test_sysmem_draw();
|
||||||
test_nrm_instruction();
|
test_nrm_instruction();
|
||||||
|
test_desktop_window();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue