From 75ac954cf5e84c6855cbcae4184b2f7ff0c3de1d Mon Sep 17 00:00:00 2001 From: "H. Verbeet" Date: Fri, 10 Feb 2006 14:52:10 +0100 Subject: [PATCH] d3d9: Use an invisible window for tests. --- dlls/d3d9/tests/shader.c | 13 ++++++++++++- dlls/d3d9/tests/stateblock.c | 13 ++++++++++++- dlls/d3d9/tests/vertexdeclaration.c | 13 ++++++++++++- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/dlls/d3d9/tests/shader.c b/dlls/d3d9/tests/shader.c index 563d5fa4d2f..f9ab6cfa436 100644 --- a/dlls/d3d9/tests/shader.c +++ b/dlls/d3d9/tests/shader.c @@ -22,6 +22,17 @@ static HMODULE d3d9_handle = 0; +static HWND create_window(void) +{ + WNDCLASS wc = {0}; + wc.lpfnWndProc = &DefWindowProc; + wc.lpszClassName = "d3d9_test_wc"; + RegisterClass(&wc); + + return CreateWindow("d3d9_test_wc", "d3d9_test", + 0, 0, 0, 0, 0, 0, 0, 0, 0); +} + static IDirect3DDevice9 *init_d3d9(void) { IDirect3D9 * (__stdcall * d3d9_create)(UINT SDKVersion) = 0; @@ -40,7 +51,7 @@ static IDirect3DDevice9 *init_d3d9(void) ZeroMemory(&present_parameters, sizeof(present_parameters)); present_parameters.Windowed = TRUE; - present_parameters.hDeviceWindow = GetDesktopWindow(); + present_parameters.hDeviceWindow = create_window(); present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; hres = IDirect3D9_CreateDevice(d3d9_ptr, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device_ptr); diff --git a/dlls/d3d9/tests/stateblock.c b/dlls/d3d9/tests/stateblock.c index a5b1938b0a8..4e3aca56b03 100644 --- a/dlls/d3d9/tests/stateblock.c +++ b/dlls/d3d9/tests/stateblock.c @@ -21,6 +21,17 @@ static HMODULE d3d9_handle = 0; +static HWND create_window(void) +{ + WNDCLASS wc = {0}; + wc.lpfnWndProc = &DefWindowProc; + wc.lpszClassName = "d3d9_test_wc"; + RegisterClass(&wc); + + return CreateWindow("d3d9_test_wc", "d3d9_test", + 0, 0, 0, 0, 0, 0, 0, 0, 0); +} + static IDirect3DDevice9 *init_d3d9(void) { IDirect3D9 * (__stdcall * d3d9_create)(UINT SDKVersion) = 0; @@ -39,7 +50,7 @@ static IDirect3DDevice9 *init_d3d9(void) ZeroMemory(&present_parameters, sizeof(present_parameters)); present_parameters.Windowed = TRUE; - present_parameters.hDeviceWindow = GetDesktopWindow(); + present_parameters.hDeviceWindow = create_window(); present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; hres = IDirect3D9_CreateDevice(d3d9_ptr, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device_ptr); diff --git a/dlls/d3d9/tests/vertexdeclaration.c b/dlls/d3d9/tests/vertexdeclaration.c index b9e0f2a7241..b6e380a417c 100644 --- a/dlls/d3d9/tests/vertexdeclaration.c +++ b/dlls/d3d9/tests/vertexdeclaration.c @@ -22,6 +22,17 @@ static HMODULE d3d9_handle = 0; +static HWND create_window(void) +{ + WNDCLASS wc = {0}; + wc.lpfnWndProc = &DefWindowProc; + wc.lpszClassName = "d3d9_test_wc"; + RegisterClass(&wc); + + return CreateWindow("d3d9_test_wc", "d3d9_test", + 0, 0, 0, 0, 0, 0, 0, 0, 0); +} + static IDirect3DDevice9 *init_d3d9(void) { IDirect3D9 * (__stdcall * d3d9_create)(UINT SDKVersion) = 0; @@ -40,7 +51,7 @@ static IDirect3DDevice9 *init_d3d9(void) ZeroMemory(&present_parameters, sizeof(present_parameters)); present_parameters.Windowed = TRUE; - present_parameters.hDeviceWindow = GetDesktopWindow(); + present_parameters.hDeviceWindow = create_window(); present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; hres = IDirect3D9_CreateDevice(d3d9_ptr, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device_ptr);