ddraw/tests: Verify that creating a ddraw object works before running any real tests.
This commit is contained in:
parent
ae63dee517
commit
0b547ee750
|
@ -443,12 +443,8 @@ static void test_coop_level_create_device_window(void)
|
||||||
|
|
||||||
focus_window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
focus_window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(focus_window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL);
|
||||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||||
|
@ -571,12 +567,8 @@ static void test_clipper_blt(void)
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
10, 10, 640, 480, 0, 0, 0, 0);
|
10, 10, 640, 480, 0, 0, 0, 0);
|
||||||
ShowWindow(window, SW_SHOW);
|
ShowWindow(window, SW_SHOW);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = GetClientRect(window, &client_rect);
|
ret = GetClientRect(window, &client_rect);
|
||||||
ok(ret, "Failed to get client rect.\n");
|
ok(ret, "Failed to get client rect.\n");
|
||||||
|
@ -739,12 +731,8 @@ static void test_coop_level_d3d_state(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -815,13 +803,8 @@ static void test_surface_interface_mismatch(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
if (!(ddraw = create_ddraw()))
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -904,11 +887,8 @@ static void test_coop_level_threaded(void)
|
||||||
IDirectDraw *ddraw;
|
IDirectDraw *ddraw;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
create_window_thread(&p);
|
create_window_thread(&p);
|
||||||
|
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, p.window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, p.window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
||||||
|
@ -938,13 +918,10 @@ static void test_viewport(void)
|
||||||
IDirect3DDevice *device;
|
IDirect3DDevice *device;
|
||||||
HWND window;
|
HWND window;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -1070,12 +1047,8 @@ static void test_zenable(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -1195,12 +1168,8 @@ static void test_ck_rgba(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -1362,13 +1331,8 @@ static void test_ck_default(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
if (!(ddraw = create_ddraw()))
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -1522,14 +1486,10 @@ static void test_ck_complex(void)
|
||||||
HWND window;
|
HWND window;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
|
if (!(device = create_device(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -1753,12 +1713,8 @@ static void test_surface_qi(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/* Try to create a D3D device to see if the ddraw implementation supports
|
/* Try to create a D3D device to see if the ddraw implementation supports
|
||||||
* D3D. 64-bit ddraw in particular doesn't seem to support D3D, and
|
* D3D. 64-bit ddraw in particular doesn't seem to support D3D, and
|
||||||
* doesn't support e.g. the IDirect3DTexture interfaces. */
|
* doesn't support e.g. the IDirect3DTexture interfaces. */
|
||||||
|
@ -1842,12 +1798,8 @@ static void test_device_qi(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -1884,11 +1836,8 @@ static void test_wndproc(void)
|
||||||
};
|
};
|
||||||
|
|
||||||
/* DDSCL_EXCLUSIVE replaces the window's window proc. */
|
/* DDSCL_EXCLUSIVE replaces the window's window proc. */
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
wc.lpfnWndProc = test_proc;
|
wc.lpfnWndProc = test_proc;
|
||||||
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
||||||
|
@ -2001,12 +1950,8 @@ static void test_window_style(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 100, 100, 0, 0, 0, 0);
|
0, 0, 100, 100, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
style = GetWindowLongA(window, GWL_STYLE);
|
style = GetWindowLongA(window, GWL_STYLE);
|
||||||
exstyle = GetWindowLongA(window, GWL_EXSTYLE);
|
exstyle = GetWindowLongA(window, GWL_EXSTYLE);
|
||||||
|
@ -2052,12 +1997,8 @@ static void test_redundant_mode_set(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 100, 100, 0, 0, 0, 0);
|
0, 0, 100, 100, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
||||||
ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr);
|
||||||
|
@ -2133,11 +2074,8 @@ static void test_coop_level_mode_set(void)
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
wc.lpfnWndProc = mode_set_proc;
|
wc.lpfnWndProc = mode_set_proc;
|
||||||
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
||||||
|
@ -2567,14 +2505,10 @@ static void test_coop_level_mode_set_multi(void)
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
ULONG ref;
|
ULONG ref;
|
||||||
|
|
||||||
if (!(ddraw1 = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 100, 100, 0, 0, 0, 0);
|
0, 0, 100, 100, 0, 0, 0, 0);
|
||||||
|
ddraw1 = create_ddraw();
|
||||||
|
ok(!!ddraw1, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
orig_w = GetSystemMetrics(SM_CXSCREEN);
|
orig_w = GetSystemMetrics(SM_CXSCREEN);
|
||||||
orig_h = GetSystemMetrics(SM_CYSCREEN);
|
orig_h = GetSystemMetrics(SM_CYSCREEN);
|
||||||
|
@ -2763,11 +2697,8 @@ static void test_initialize(void)
|
||||||
IDirect3D *d3d;
|
IDirect3D *d3d;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw_Initialize(ddraw, NULL);
|
hr = IDirectDraw_Initialize(ddraw, NULL);
|
||||||
ok(hr == DDERR_ALREADYINITIALIZED, "Initialize returned hr %#x.\n", hr);
|
ok(hr == DDERR_ALREADYINITIALIZED, "Initialize returned hr %#x.\n", hr);
|
||||||
|
@ -2809,11 +2740,8 @@ static void test_coop_level_surf_create(void)
|
||||||
DDSURFACEDESC ddsd;
|
DDSURFACEDESC ddsd;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&ddsd, 0, sizeof(ddsd));
|
memset(&ddsd, 0, sizeof(ddsd));
|
||||||
ddsd.dwSize = sizeof(ddsd);
|
ddsd.dwSize = sizeof(ddsd);
|
||||||
|
@ -2835,13 +2763,8 @@ static void test_coop_level_multi_window(void)
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
window2 = CreateWindowA("static", "ddraw_test2", WS_OVERLAPPEDWINDOW,
|
window2 = CreateWindowA("static", "ddraw_test2", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window2);
|
|
||||||
DestroyWindow(window1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, window1, DDSCL_NORMAL);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, window1, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
@ -2869,12 +2792,8 @@ static void test_clear_rect_count(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -2955,11 +2874,8 @@ static void test_coop_level_activateapp(void)
|
||||||
DDSURFACEDESC ddsd;
|
DDSURFACEDESC ddsd;
|
||||||
IDirectDrawSurface *surface;
|
IDirectDrawSurface *surface;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
wc.lpfnWndProc = activateapp_test_proc;
|
wc.lpfnWndProc = activateapp_test_proc;
|
||||||
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
||||||
|
@ -3113,12 +3029,8 @@ static void test_unsupported_formats(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -3352,14 +3264,10 @@ static void test_rt_caps(void)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -3555,14 +3463,10 @@ static void test_primary_caps(void)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i)
|
for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i)
|
||||||
{
|
{
|
||||||
|
@ -3645,14 +3549,10 @@ static void test_surface_lock(void)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -3727,12 +3627,8 @@ static void test_surface_discard(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -3812,14 +3708,10 @@ static void test_flip(void)
|
||||||
DDBLTFX fx;
|
DDBLTFX fx;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
hr = set_display_mode(ddraw, 640, 480);
|
hr = set_display_mode(ddraw, 640, 480);
|
||||||
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
|
||||||
|
@ -3994,14 +3886,10 @@ static void test_sysmem_overlay(void)
|
||||||
IDirectDrawSurface *surface;
|
IDirectDrawSurface *surface;
|
||||||
ULONG ref;
|
ULONG ref;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
@ -4039,18 +3927,13 @@ static void test_primary_palette(void)
|
||||||
HWND window;
|
HWND window;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
hr = IDirectDraw_SetDisplayMode(ddraw, 640, 480, 8);
|
ddraw = create_ddraw();
|
||||||
if (hr == E_NOTIMPL)
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
|
if (FAILED(hr = IDirectDraw_SetDisplayMode(ddraw, 640, 480, 8)))
|
||||||
{
|
{
|
||||||
win_skip("changing display mode is not supported (8bpp)\n");
|
win_skip("Failed to set 8 bpp display mode, skipping test.\n");
|
||||||
IDirectDraw_Release(ddraw);
|
IDirectDraw_Release(ddraw);
|
||||||
DestroyWindow(window);
|
DestroyWindow(window);
|
||||||
return;
|
return;
|
||||||
|
@ -4151,14 +4034,10 @@ static void test_surface_attachment(void)
|
||||||
HWND window;
|
HWND window;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -4447,11 +4326,7 @@ static void test_pixel_format(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
ddraw = create_ddraw();
|
ddraw = create_ddraw();
|
||||||
if (!ddraw)
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
{
|
|
||||||
skip("Failed to create ddraw object\n");
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
test_format = GetPixelFormat(hdc);
|
test_format = GetPixelFormat(hdc);
|
||||||
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
|
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
|
||||||
|
@ -4577,14 +4452,10 @@ static void test_create_surface_pitch(void)
|
||||||
};
|
};
|
||||||
DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE;
|
DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -4634,6 +4505,15 @@ static void test_create_surface_pitch(void)
|
||||||
|
|
||||||
START_TEST(ddraw1)
|
START_TEST(ddraw1)
|
||||||
{
|
{
|
||||||
|
IDirectDraw *ddraw;
|
||||||
|
|
||||||
|
if (!(ddraw = create_ddraw()))
|
||||||
|
{
|
||||||
|
skip("Failed to create a ddraw object, skipping tests.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
IDirectDraw_Release(ddraw);
|
||||||
|
|
||||||
test_coop_level_create_device_window();
|
test_coop_level_create_device_window();
|
||||||
test_clipper_blt();
|
test_clipper_blt();
|
||||||
test_coop_level_d3d_state();
|
test_coop_level_d3d_state();
|
||||||
|
|
|
@ -391,12 +391,8 @@ static void test_coop_level_create_device_window(void)
|
||||||
|
|
||||||
focus_window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
focus_window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(focus_window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL);
|
hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL);
|
||||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||||
|
@ -519,12 +515,8 @@ static void test_clipper_blt(void)
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
10, 10, 640, 480, 0, 0, 0, 0);
|
10, 10, 640, 480, 0, 0, 0, 0);
|
||||||
ShowWindow(window, SW_SHOW);
|
ShowWindow(window, SW_SHOW);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = GetClientRect(window, &client_rect);
|
ret = GetClientRect(window, &client_rect);
|
||||||
ok(ret, "Failed to get client rect.\n");
|
ok(ret, "Failed to get client rect.\n");
|
||||||
|
@ -688,12 +680,8 @@ static void test_coop_level_d3d_state(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -779,13 +767,8 @@ static void test_surface_interface_mismatch(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
if (!(ddraw = create_ddraw()))
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -875,11 +858,8 @@ static void test_coop_level_threaded(void)
|
||||||
IDirectDraw2 *ddraw;
|
IDirectDraw2 *ddraw;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
create_window_thread(&p);
|
create_window_thread(&p);
|
||||||
|
|
||||||
hr = IDirectDraw2_SetCooperativeLevel(ddraw, p.window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
hr = IDirectDraw2_SetCooperativeLevel(ddraw, p.window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
||||||
|
@ -922,12 +902,8 @@ static void test_depth_blit(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -1076,11 +1052,8 @@ static void test_texture_load_ckey(void)
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
DDCOLORKEY ckey;
|
DDCOLORKEY ckey;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL);
|
hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -1185,13 +1158,10 @@ static void test_viewport(void)
|
||||||
IDirect3DDevice2 *device;
|
IDirect3DDevice2 *device;
|
||||||
HWND window;
|
HWND window;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -1378,12 +1348,8 @@ static void test_zenable(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -1483,12 +1449,8 @@ static void test_ck_rgba(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -1625,13 +1587,8 @@ static void test_ck_default(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
if (!(ddraw = create_ddraw()))
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -1733,14 +1690,10 @@ static void test_ck_complex(void)
|
||||||
HWND window;
|
HWND window;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
|
if (!(device = create_device(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -1964,12 +1917,8 @@ static void test_surface_qi(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/* Try to create a D3D device to see if the ddraw implementation supports
|
/* Try to create a D3D device to see if the ddraw implementation supports
|
||||||
* D3D. 64-bit ddraw in particular doesn't seem to support D3D, and
|
* D3D. 64-bit ddraw in particular doesn't seem to support D3D, and
|
||||||
* doesn't support e.g. the IDirect3DTexture interfaces. */
|
* doesn't support e.g. the IDirect3DTexture interfaces. */
|
||||||
|
@ -2052,12 +2001,8 @@ static void test_device_qi(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -2094,11 +2039,8 @@ static void test_wndproc(void)
|
||||||
};
|
};
|
||||||
|
|
||||||
/* DDSCL_EXCLUSIVE replaces the window's window proc. */
|
/* DDSCL_EXCLUSIVE replaces the window's window proc. */
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
wc.lpfnWndProc = test_proc;
|
wc.lpfnWndProc = test_proc;
|
||||||
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
||||||
|
@ -2211,12 +2153,8 @@ static void test_window_style(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 100, 100, 0, 0, 0, 0);
|
0, 0, 100, 100, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
style = GetWindowLongA(window, GWL_STYLE);
|
style = GetWindowLongA(window, GWL_STYLE);
|
||||||
exstyle = GetWindowLongA(window, GWL_EXSTYLE);
|
exstyle = GetWindowLongA(window, GWL_EXSTYLE);
|
||||||
|
@ -2262,12 +2200,8 @@ static void test_redundant_mode_set(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 100, 100, 0, 0, 0, 0);
|
0, 0, 100, 100, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
||||||
ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr);
|
||||||
|
@ -2354,11 +2288,9 @@ static void test_coop_level_mode_set(void)
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
wc.lpfnWndProc = mode_set_proc;
|
wc.lpfnWndProc = mode_set_proc;
|
||||||
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
||||||
ok(RegisterClassA(&wc), "Failed to register window class.\n");
|
ok(RegisterClassA(&wc), "Failed to register window class.\n");
|
||||||
|
@ -2881,14 +2813,10 @@ static void test_coop_level_mode_set_multi(void)
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
ULONG ref;
|
ULONG ref;
|
||||||
|
|
||||||
if (!(ddraw1 = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 100, 100, 0, 0, 0, 0);
|
0, 0, 100, 100, 0, 0, 0, 0);
|
||||||
|
ddraw1 = create_ddraw();
|
||||||
|
ok(!!ddraw1, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
orig_w = GetSystemMetrics(SM_CXSCREEN);
|
orig_w = GetSystemMetrics(SM_CXSCREEN);
|
||||||
orig_h = GetSystemMetrics(SM_CYSCREEN);
|
orig_h = GetSystemMetrics(SM_CYSCREEN);
|
||||||
|
@ -3076,11 +3004,8 @@ static void test_initialize(void)
|
||||||
IDirectDraw2 *ddraw;
|
IDirectDraw2 *ddraw;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw2_Initialize(ddraw, NULL);
|
hr = IDirectDraw2_Initialize(ddraw, NULL);
|
||||||
ok(hr == DDERR_ALREADYINITIALIZED, "Initialize returned hr %#x.\n", hr);
|
ok(hr == DDERR_ALREADYINITIALIZED, "Initialize returned hr %#x.\n", hr);
|
||||||
|
@ -3104,11 +3029,8 @@ static void test_coop_level_surf_create(void)
|
||||||
DDSURFACEDESC ddsd;
|
DDSURFACEDESC ddsd;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&ddsd, 0, sizeof(ddsd));
|
memset(&ddsd, 0, sizeof(ddsd));
|
||||||
ddsd.dwSize = sizeof(ddsd);
|
ddsd.dwSize = sizeof(ddsd);
|
||||||
|
@ -3130,13 +3052,8 @@ static void test_coop_level_multi_window(void)
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
window2 = CreateWindowA("static", "ddraw_test2", WS_OVERLAPPEDWINDOW,
|
window2 = CreateWindowA("static", "ddraw_test2", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window2);
|
|
||||||
DestroyWindow(window1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw2_SetCooperativeLevel(ddraw, window1, DDSCL_NORMAL);
|
hr = IDirectDraw2_SetCooperativeLevel(ddraw, window1, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
@ -3164,12 +3081,8 @@ static void test_clear_rect_count(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -3257,8 +3170,8 @@ static void test_coop_level_versions(void)
|
||||||
window = CreateWindowA("static", "ddraw_test1", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test1", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
|
||||||
if (!(ddraw2 = create_ddraw()))
|
ddraw2 = create_ddraw();
|
||||||
goto done;
|
ok(!!ddraw2, "Failed to create a ddraw object.\n");
|
||||||
/* Newly created ddraw objects restore the mode on ddraw2+::SetCooperativeLevel(NORMAL) */
|
/* Newly created ddraw objects restore the mode on ddraw2+::SetCooperativeLevel(NORMAL) */
|
||||||
restored = test_mode_restored(ddraw2, window);
|
restored = test_mode_restored(ddraw2, window);
|
||||||
ok(restored, "Display mode not restored in new ddraw object\n");
|
ok(restored, "Display mode not restored in new ddraw object\n");
|
||||||
|
@ -3281,8 +3194,8 @@ static void test_coop_level_versions(void)
|
||||||
IDirectDraw_Release(ddraw);
|
IDirectDraw_Release(ddraw);
|
||||||
IDirectDraw2_Release(ddraw2);
|
IDirectDraw2_Release(ddraw2);
|
||||||
|
|
||||||
if (!(ddraw2 = create_ddraw()))
|
ddraw2 = create_ddraw();
|
||||||
goto done;
|
ok(!!ddraw2, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw2_QueryInterface(ddraw2, &IID_IDirectDraw, (void **)&ddraw);
|
hr = IDirectDraw2_QueryInterface(ddraw2, &IID_IDirectDraw, (void **)&ddraw);
|
||||||
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -3295,8 +3208,8 @@ static void test_coop_level_versions(void)
|
||||||
IDirectDraw2_Release(ddraw2);
|
IDirectDraw2_Release(ddraw2);
|
||||||
|
|
||||||
/* A failing call does not restore the ddraw2+ behavior */
|
/* A failing call does not restore the ddraw2+ behavior */
|
||||||
if (!(ddraw2 = create_ddraw()))
|
ddraw2 = create_ddraw();
|
||||||
goto done;
|
ok(!!ddraw2, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw2_QueryInterface(ddraw2, &IID_IDirectDraw, (void **)&ddraw);
|
hr = IDirectDraw2_QueryInterface(ddraw2, &IID_IDirectDraw, (void **)&ddraw);
|
||||||
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -3311,8 +3224,8 @@ static void test_coop_level_versions(void)
|
||||||
IDirectDraw2_Release(ddraw2);
|
IDirectDraw2_Release(ddraw2);
|
||||||
|
|
||||||
/* Neither does a sequence of successful calls with the new interface */
|
/* Neither does a sequence of successful calls with the new interface */
|
||||||
if (!(ddraw2 = create_ddraw()))
|
ddraw2 = create_ddraw();
|
||||||
goto done;
|
ok(!!ddraw2, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw2_QueryInterface(ddraw2, &IID_IDirectDraw, (void **)&ddraw);
|
hr = IDirectDraw2_QueryInterface(ddraw2, &IID_IDirectDraw, (void **)&ddraw);
|
||||||
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -3329,8 +3242,8 @@ static void test_coop_level_versions(void)
|
||||||
IDirectDraw2_Release(ddraw2);
|
IDirectDraw2_Release(ddraw2);
|
||||||
|
|
||||||
/* ddraw1::CreateSurface does not triger the ddraw1 behavior */
|
/* ddraw1::CreateSurface does not triger the ddraw1 behavior */
|
||||||
if (!(ddraw2 = create_ddraw()))
|
ddraw2 = create_ddraw();
|
||||||
goto done;
|
ok(!!ddraw2, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw2_QueryInterface(ddraw2, &IID_IDirectDraw, (void **)&ddraw);
|
hr = IDirectDraw2_QueryInterface(ddraw2, &IID_IDirectDraw, (void **)&ddraw);
|
||||||
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -3350,8 +3263,6 @@ static void test_coop_level_versions(void)
|
||||||
|
|
||||||
IDirectDraw_Release(ddraw);
|
IDirectDraw_Release(ddraw);
|
||||||
IDirectDraw2_Release(ddraw2);
|
IDirectDraw2_Release(ddraw2);
|
||||||
|
|
||||||
done:
|
|
||||||
DestroyWindow(window);
|
DestroyWindow(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3436,12 +3347,8 @@ static void test_lighting_interface_versions(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -3553,11 +3460,8 @@ static void test_coop_level_activateapp(void)
|
||||||
DDSURFACEDESC ddsd;
|
DDSURFACEDESC ddsd;
|
||||||
IDirectDrawSurface *surface;
|
IDirectDrawSurface *surface;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
wc.lpfnWndProc = activateapp_test_proc;
|
wc.lpfnWndProc = activateapp_test_proc;
|
||||||
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
||||||
|
@ -3711,12 +3615,8 @@ static void test_unsupported_formats(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -3993,14 +3893,10 @@ static void test_rt_caps(void)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -4261,14 +4157,10 @@ static void test_primary_caps(void)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i)
|
for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i)
|
||||||
{
|
{
|
||||||
|
@ -4351,14 +4243,10 @@ static void test_surface_lock(void)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
|
||||||
{
|
{
|
||||||
skip("Failed to create a 3D device, skipping test.\n");
|
skip("Failed to create a 3D device, skipping test.\n");
|
||||||
|
@ -4433,12 +4321,8 @@ static void test_surface_discard(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -4518,14 +4402,10 @@ static void test_flip(void)
|
||||||
DDBLTFX fx;
|
DDBLTFX fx;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
hr = set_display_mode(ddraw, 640, 480);
|
hr = set_display_mode(ddraw, 640, 480);
|
||||||
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
|
||||||
|
@ -4721,15 +4601,10 @@ static void test_set_surface_desc(void)
|
||||||
{DDSCAPS_PRIMARYSURFACE | DDSCAPS_SYSTEMMEMORY, FALSE, "systemmemory primary"},
|
{DDSCAPS_PRIMARYSURFACE | DDSCAPS_SYSTEMMEMORY, FALSE, "systemmemory primary"},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -5020,14 +4895,10 @@ static void test_user_memory_getdc(void)
|
||||||
HDC dc;
|
HDC dc;
|
||||||
unsigned int x, y;
|
unsigned int x, y;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
@ -5119,14 +4990,10 @@ static void test_sysmem_overlay(void)
|
||||||
IDirectDrawSurface *surface;
|
IDirectDrawSurface *surface;
|
||||||
ULONG ref;
|
ULONG ref;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
@ -5163,18 +5030,13 @@ static void test_primary_palette(void)
|
||||||
HWND window;
|
HWND window;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
hr = IDirectDraw2_SetDisplayMode(ddraw, 640, 480, 8, 0, 0);
|
ddraw = create_ddraw();
|
||||||
if (hr == E_NOTIMPL)
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
|
if (FAILED(hr = IDirectDraw2_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
|
||||||
{
|
{
|
||||||
win_skip("changing display mode is not supported (8bpp)\n");
|
win_skip("Failed to set 8 bpp display mode, skipping test.\n");
|
||||||
IDirectDraw2_Release(ddraw);
|
IDirectDraw2_Release(ddraw);
|
||||||
DestroyWindow(window);
|
DestroyWindow(window);
|
||||||
return;
|
return;
|
||||||
|
@ -5275,14 +5137,10 @@ static void test_surface_attachment(void)
|
||||||
HWND window;
|
HWND window;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -5571,11 +5429,7 @@ static void test_pixel_format(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
ddraw = create_ddraw();
|
ddraw = create_ddraw();
|
||||||
if (!ddraw)
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
{
|
|
||||||
skip("Failed to create ddraw object\n");
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
test_format = GetPixelFormat(hdc);
|
test_format = GetPixelFormat(hdc);
|
||||||
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
|
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
|
||||||
|
@ -5701,14 +5555,10 @@ static void test_create_surface_pitch(void)
|
||||||
};
|
};
|
||||||
DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE;
|
DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -5758,6 +5608,15 @@ static void test_create_surface_pitch(void)
|
||||||
|
|
||||||
START_TEST(ddraw2)
|
START_TEST(ddraw2)
|
||||||
{
|
{
|
||||||
|
IDirectDraw2 *ddraw;
|
||||||
|
|
||||||
|
if (!(ddraw = create_ddraw()))
|
||||||
|
{
|
||||||
|
skip("Failed to create a ddraw object, skipping tests.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
IDirectDraw2_Release(ddraw);
|
||||||
|
|
||||||
test_coop_level_create_device_window();
|
test_coop_level_create_device_window();
|
||||||
test_clipper_blt();
|
test_clipper_blt();
|
||||||
test_coop_level_d3d_state();
|
test_coop_level_d3d_state();
|
||||||
|
|
|
@ -583,12 +583,8 @@ static void test_coop_level_create_device_window(void)
|
||||||
|
|
||||||
focus_window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
focus_window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(focus_window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw4_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL);
|
hr = IDirectDraw4_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL);
|
||||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||||
|
@ -711,12 +707,8 @@ static void test_clipper_blt(void)
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
10, 10, 640, 480, 0, 0, 0, 0);
|
10, 10, 640, 480, 0, 0, 0, 0);
|
||||||
ShowWindow(window, SW_SHOW);
|
ShowWindow(window, SW_SHOW);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = GetClientRect(window, &client_rect);
|
ret = GetClientRect(window, &client_rect);
|
||||||
ok(ret, "Failed to get client rect.\n");
|
ok(ret, "Failed to get client rect.\n");
|
||||||
|
@ -955,13 +947,8 @@ static void test_surface_interface_mismatch(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
if (!(ddraw = create_ddraw()))
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -1042,11 +1029,8 @@ static void test_coop_level_threaded(void)
|
||||||
IDirectDraw4 *ddraw;
|
IDirectDraw4 *ddraw;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
create_window_thread(&p);
|
create_window_thread(&p);
|
||||||
|
|
||||||
hr = IDirectDraw4_SetCooperativeLevel(ddraw, p.window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
hr = IDirectDraw4_SetCooperativeLevel(ddraw, p.window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
||||||
|
@ -1242,11 +1226,8 @@ static void test_texture_load_ckey(void)
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
DDCOLORKEY ckey;
|
DDCOLORKEY ckey;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
hr = IDirectDraw4_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL);
|
hr = IDirectDraw4_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -2108,12 +2089,8 @@ static void test_surface_qi(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
IDirect3DDevice_Release(device);
|
IDirect3DDevice_Release(device);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -2220,11 +2197,8 @@ static void test_wndproc(void)
|
||||||
};
|
};
|
||||||
|
|
||||||
/* DDSCL_EXCLUSIVE replaces the window's window proc. */
|
/* DDSCL_EXCLUSIVE replaces the window's window proc. */
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
wc.lpfnWndProc = test_proc;
|
wc.lpfnWndProc = test_proc;
|
||||||
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
||||||
|
@ -2337,12 +2311,8 @@ static void test_window_style(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 100, 100, 0, 0, 0, 0);
|
0, 0, 100, 100, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
style = GetWindowLongA(window, GWL_STYLE);
|
style = GetWindowLongA(window, GWL_STYLE);
|
||||||
exstyle = GetWindowLongA(window, GWL_EXSTYLE);
|
exstyle = GetWindowLongA(window, GWL_EXSTYLE);
|
||||||
|
@ -2388,12 +2358,8 @@ static void test_redundant_mode_set(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 100, 100, 0, 0, 0, 0);
|
0, 0, 100, 100, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
||||||
ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr);
|
||||||
|
@ -2480,11 +2446,8 @@ static void test_coop_level_mode_set(void)
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
wc.lpfnWndProc = mode_set_proc;
|
wc.lpfnWndProc = mode_set_proc;
|
||||||
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
||||||
|
@ -3000,14 +2963,10 @@ static void test_coop_level_mode_set_multi(void)
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
ULONG ref;
|
ULONG ref;
|
||||||
|
|
||||||
if (!(ddraw1 = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 100, 100, 0, 0, 0, 0);
|
0, 0, 100, 100, 0, 0, 0, 0);
|
||||||
|
ddraw1 = create_ddraw();
|
||||||
|
ok(!!ddraw1, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
orig_w = GetSystemMetrics(SM_CXSCREEN);
|
orig_w = GetSystemMetrics(SM_CXSCREEN);
|
||||||
orig_h = GetSystemMetrics(SM_CYSCREEN);
|
orig_h = GetSystemMetrics(SM_CYSCREEN);
|
||||||
|
@ -3188,11 +3147,8 @@ static void test_initialize(void)
|
||||||
IDirectDraw4 *ddraw;
|
IDirectDraw4 *ddraw;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw4_Initialize(ddraw, NULL);
|
hr = IDirectDraw4_Initialize(ddraw, NULL);
|
||||||
ok(hr == DDERR_ALREADYINITIALIZED, "Initialize returned hr %#x.\n", hr);
|
ok(hr == DDERR_ALREADYINITIALIZED, "Initialize returned hr %#x.\n", hr);
|
||||||
|
@ -3216,11 +3172,8 @@ static void test_coop_level_surf_create(void)
|
||||||
DDSURFACEDESC2 ddsd;
|
DDSURFACEDESC2 ddsd;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&ddsd, 0, sizeof(ddsd));
|
memset(&ddsd, 0, sizeof(ddsd));
|
||||||
ddsd.dwSize = sizeof(ddsd);
|
ddsd.dwSize = sizeof(ddsd);
|
||||||
|
@ -3321,13 +3274,8 @@ static void test_coop_level_multi_window(void)
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
window2 = CreateWindowA("static", "ddraw_test2", WS_OVERLAPPEDWINDOW,
|
window2 = CreateWindowA("static", "ddraw_test2", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window2);
|
|
||||||
DestroyWindow(window1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window1, DDSCL_NORMAL);
|
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window1, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
@ -3493,8 +3441,8 @@ static void test_coop_level_versions(void)
|
||||||
window = CreateWindowA("static", "ddraw_test1", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test1", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
|
||||||
if (!(ddraw4 = create_ddraw()))
|
ddraw4 = create_ddraw();
|
||||||
goto done;
|
ok(!!ddraw4, "Failed to create a ddraw object.\n");
|
||||||
/* Newly created ddraw objects restore the mode on ddraw2+::SetCooperativeLevel(NORMAL) */
|
/* Newly created ddraw objects restore the mode on ddraw2+::SetCooperativeLevel(NORMAL) */
|
||||||
restored = test_mode_restored(ddraw4, window);
|
restored = test_mode_restored(ddraw4, window);
|
||||||
ok(restored, "Display mode not restored in new ddraw object\n");
|
ok(restored, "Display mode not restored in new ddraw object\n");
|
||||||
|
@ -3517,8 +3465,8 @@ static void test_coop_level_versions(void)
|
||||||
IDirectDraw_Release(ddraw);
|
IDirectDraw_Release(ddraw);
|
||||||
IDirectDraw4_Release(ddraw4);
|
IDirectDraw4_Release(ddraw4);
|
||||||
|
|
||||||
if (!(ddraw4 = create_ddraw()))
|
ddraw4 = create_ddraw();
|
||||||
goto done;
|
ok(!!ddraw4, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw4_QueryInterface(ddraw4, &IID_IDirectDraw, (void **)&ddraw);
|
hr = IDirectDraw4_QueryInterface(ddraw4, &IID_IDirectDraw, (void **)&ddraw);
|
||||||
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -3531,8 +3479,8 @@ static void test_coop_level_versions(void)
|
||||||
IDirectDraw4_Release(ddraw4);
|
IDirectDraw4_Release(ddraw4);
|
||||||
|
|
||||||
/* A failing call does not restore the ddraw2+ behavior */
|
/* A failing call does not restore the ddraw2+ behavior */
|
||||||
if (!(ddraw4 = create_ddraw()))
|
ddraw4 = create_ddraw();
|
||||||
goto done;
|
ok(!!ddraw4, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw4_QueryInterface(ddraw4, &IID_IDirectDraw, (void **)&ddraw);
|
hr = IDirectDraw4_QueryInterface(ddraw4, &IID_IDirectDraw, (void **)&ddraw);
|
||||||
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -3547,8 +3495,8 @@ static void test_coop_level_versions(void)
|
||||||
IDirectDraw4_Release(ddraw4);
|
IDirectDraw4_Release(ddraw4);
|
||||||
|
|
||||||
/* Neither does a sequence of successful calls with the new interface */
|
/* Neither does a sequence of successful calls with the new interface */
|
||||||
if (!(ddraw4 = create_ddraw()))
|
ddraw4 = create_ddraw();
|
||||||
goto done;
|
ok(!!ddraw4, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw4_QueryInterface(ddraw4, &IID_IDirectDraw, (void **)&ddraw);
|
hr = IDirectDraw4_QueryInterface(ddraw4, &IID_IDirectDraw, (void **)&ddraw);
|
||||||
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -3565,8 +3513,8 @@ static void test_coop_level_versions(void)
|
||||||
IDirectDraw4_Release(ddraw4);
|
IDirectDraw4_Release(ddraw4);
|
||||||
|
|
||||||
/* ddraw1::CreateSurface does not triger the ddraw1 behavior */
|
/* ddraw1::CreateSurface does not triger the ddraw1 behavior */
|
||||||
if (!(ddraw4 = create_ddraw()))
|
ddraw4 = create_ddraw();
|
||||||
goto done;
|
ok(!!ddraw4, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw4_QueryInterface(ddraw4, &IID_IDirectDraw, (void **)&ddraw);
|
hr = IDirectDraw4_QueryInterface(ddraw4, &IID_IDirectDraw, (void **)&ddraw);
|
||||||
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -3586,8 +3534,6 @@ static void test_coop_level_versions(void)
|
||||||
|
|
||||||
IDirectDraw_Release(ddraw);
|
IDirectDraw_Release(ddraw);
|
||||||
IDirectDraw4_Release(ddraw4);
|
IDirectDraw4_Release(ddraw4);
|
||||||
|
|
||||||
done:
|
|
||||||
DestroyWindow(window);
|
DestroyWindow(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3838,11 +3784,8 @@ static void test_coop_level_activateapp(void)
|
||||||
DDSURFACEDESC2 ddsd;
|
DDSURFACEDESC2 ddsd;
|
||||||
IDirectDrawSurface4 *surface;
|
IDirectDrawSurface4 *surface;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
wc.lpfnWndProc = activateapp_test_proc;
|
wc.lpfnWndProc = activateapp_test_proc;
|
||||||
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
||||||
|
@ -3992,12 +3935,8 @@ static void test_texturemanage(void)
|
||||||
DDSCAPS_SYSTEMMEMORY, 0},
|
DDSCAPS_SYSTEMMEMORY, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw4_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL);
|
hr = IDirectDraw4_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -4581,14 +4520,10 @@ static void test_rt_caps(void)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -4829,14 +4764,10 @@ static void test_primary_caps(void)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i)
|
for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i)
|
||||||
{
|
{
|
||||||
|
@ -4952,14 +4883,10 @@ static void test_surface_lock(void)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -5133,14 +5060,10 @@ static void test_flip(void)
|
||||||
DDBLTFX fx;
|
DDBLTFX fx;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
hr = set_display_mode(ddraw, 640, 480);
|
hr = set_display_mode(ddraw, 640, 480);
|
||||||
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
|
||||||
|
@ -5337,15 +5260,10 @@ static void test_set_surface_desc(void)
|
||||||
{DDSCAPS_PRIMARYSURFACE | DDSCAPS_SYSTEMMEMORY, 0, FALSE, "systemmemory primary"},
|
{DDSCAPS_PRIMARYSURFACE | DDSCAPS_SYSTEMMEMORY, 0, FALSE, "systemmemory primary"},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -5632,14 +5550,10 @@ static void test_user_memory_getdc(void)
|
||||||
HDC dc;
|
HDC dc;
|
||||||
unsigned int x, y;
|
unsigned int x, y;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
@ -5727,14 +5641,10 @@ static void test_sysmem_overlay(void)
|
||||||
IDirectDrawSurface4 *surface;
|
IDirectDrawSurface4 *surface;
|
||||||
ULONG ref;
|
ULONG ref;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
@ -5771,18 +5681,13 @@ static void test_primary_palette(void)
|
||||||
HWND window;
|
HWND window;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
hr = IDirectDraw4_SetDisplayMode(ddraw, 640, 480, 8, 0, 0);
|
ddraw = create_ddraw();
|
||||||
if (hr == E_NOTIMPL)
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
|
if (FAILED(hr = IDirectDraw4_SetDisplayMode(ddraw, 640, 480, 8, 0, 0)))
|
||||||
{
|
{
|
||||||
win_skip("changing display mode is not supported (8bpp)\n");
|
win_skip("Failed to set 8 bpp display mode, skipping test.\n");
|
||||||
IDirectDraw4_Release(ddraw);
|
IDirectDraw4_Release(ddraw);
|
||||||
DestroyWindow(window);
|
DestroyWindow(window);
|
||||||
return;
|
return;
|
||||||
|
@ -5884,14 +5789,10 @@ static void test_surface_attachment(void)
|
||||||
HWND window;
|
HWND window;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -6145,14 +6046,10 @@ static void test_private_data(void)
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
HWND window;
|
HWND window;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -6290,11 +6187,7 @@ static void test_pixel_format(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
ddraw = create_ddraw();
|
ddraw = create_ddraw();
|
||||||
if (!ddraw)
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
{
|
|
||||||
skip("Failed to create ddraw object\n");
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
test_format = GetPixelFormat(hdc);
|
test_format = GetPixelFormat(hdc);
|
||||||
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
|
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
|
||||||
|
@ -6424,14 +6317,10 @@ static void test_create_surface_pitch(void)
|
||||||
};
|
};
|
||||||
DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE;
|
DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -6481,6 +6370,15 @@ static void test_create_surface_pitch(void)
|
||||||
|
|
||||||
START_TEST(ddraw4)
|
START_TEST(ddraw4)
|
||||||
{
|
{
|
||||||
|
IDirectDraw4 *ddraw;
|
||||||
|
|
||||||
|
if (!(ddraw = create_ddraw()))
|
||||||
|
{
|
||||||
|
skip("Failed to create a ddraw object, skipping tests.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
IDirectDraw4_Release(ddraw);
|
||||||
|
|
||||||
test_process_vertices();
|
test_process_vertices();
|
||||||
test_coop_level_create_device_window();
|
test_coop_level_create_device_window();
|
||||||
test_clipper_blt();
|
test_clipper_blt();
|
||||||
|
|
|
@ -557,12 +557,8 @@ static void test_coop_level_create_device_window(void)
|
||||||
|
|
||||||
focus_window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
focus_window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(focus_window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw7_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL);
|
hr = IDirectDraw7_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL);
|
||||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||||
|
@ -685,12 +681,8 @@ static void test_clipper_blt(void)
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
10, 10, 640, 480, 0, 0, 0, 0);
|
10, 10, 640, 480, 0, 0, 0, 0);
|
||||||
ShowWindow(window, SW_SHOW);
|
ShowWindow(window, SW_SHOW);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = GetClientRect(window, &client_rect);
|
ret = GetClientRect(window, &client_rect);
|
||||||
ok(ret, "Failed to get client rect.\n");
|
ok(ret, "Failed to get client rect.\n");
|
||||||
|
@ -922,13 +914,8 @@ static void test_surface_interface_mismatch(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
if (!(ddraw = create_ddraw()))
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -1005,11 +992,8 @@ static void test_coop_level_threaded(void)
|
||||||
IDirectDraw7 *ddraw;
|
IDirectDraw7 *ddraw;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
create_window_thread(&p);
|
create_window_thread(&p);
|
||||||
|
|
||||||
hr = IDirectDraw7_SetCooperativeLevel(ddraw, p.window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
hr = IDirectDraw7_SetCooperativeLevel(ddraw, p.window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
||||||
|
@ -1834,12 +1818,8 @@ static void test_surface_qi(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
IDirect3DDevice_Release(device);
|
IDirect3DDevice_Release(device);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -1946,11 +1926,8 @@ static void test_wndproc(void)
|
||||||
};
|
};
|
||||||
|
|
||||||
/* DDSCL_EXCLUSIVE replaces the window's window proc. */
|
/* DDSCL_EXCLUSIVE replaces the window's window proc. */
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
wc.lpfnWndProc = test_proc;
|
wc.lpfnWndProc = test_proc;
|
||||||
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
||||||
|
@ -2063,12 +2040,8 @@ static void test_window_style(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 100, 100, 0, 0, 0, 0);
|
0, 0, 100, 100, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
style = GetWindowLongA(window, GWL_STYLE);
|
style = GetWindowLongA(window, GWL_STYLE);
|
||||||
exstyle = GetWindowLongA(window, GWL_EXSTYLE);
|
exstyle = GetWindowLongA(window, GWL_EXSTYLE);
|
||||||
|
@ -2114,13 +2087,8 @@ static void test_redundant_mode_set(void)
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 100, 100, 0, 0, 0, 0);
|
0, 0, 100, 100, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
||||||
ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -2206,11 +2174,8 @@ static void test_coop_level_mode_set(void)
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
wc.lpfnWndProc = mode_set_proc;
|
wc.lpfnWndProc = mode_set_proc;
|
||||||
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
||||||
|
@ -2726,14 +2691,10 @@ static void test_coop_level_mode_set_multi(void)
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
ULONG ref;
|
ULONG ref;
|
||||||
|
|
||||||
if (!(ddraw1 = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 100, 100, 0, 0, 0, 0);
|
0, 0, 100, 100, 0, 0, 0, 0);
|
||||||
|
ddraw1 = create_ddraw();
|
||||||
|
ok(!!ddraw1, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
orig_w = GetSystemMetrics(SM_CXSCREEN);
|
orig_w = GetSystemMetrics(SM_CXSCREEN);
|
||||||
orig_h = GetSystemMetrics(SM_CYSCREEN);
|
orig_h = GetSystemMetrics(SM_CYSCREEN);
|
||||||
|
@ -2914,11 +2875,8 @@ static void test_initialize(void)
|
||||||
IDirectDraw7 *ddraw;
|
IDirectDraw7 *ddraw;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw7_Initialize(ddraw, NULL);
|
hr = IDirectDraw7_Initialize(ddraw, NULL);
|
||||||
ok(hr == DDERR_ALREADYINITIALIZED, "Initialize returned hr %#x.\n", hr);
|
ok(hr == DDERR_ALREADYINITIALIZED, "Initialize returned hr %#x.\n", hr);
|
||||||
|
@ -2942,11 +2900,8 @@ static void test_coop_level_surf_create(void)
|
||||||
DDSURFACEDESC2 ddsd;
|
DDSURFACEDESC2 ddsd;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&ddsd, 0, sizeof(ddsd));
|
memset(&ddsd, 0, sizeof(ddsd));
|
||||||
ddsd.dwSize = sizeof(ddsd);
|
ddsd.dwSize = sizeof(ddsd);
|
||||||
|
@ -3047,13 +3002,8 @@ static void test_coop_level_multi_window(void)
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
window2 = CreateWindowA("static", "ddraw_test2", WS_OVERLAPPEDWINDOW,
|
window2 = CreateWindowA("static", "ddraw_test2", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
DestroyWindow(window2);
|
|
||||||
DestroyWindow(window1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window1, DDSCL_NORMAL);
|
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window1, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
@ -3216,8 +3166,8 @@ static void test_coop_level_versions(void)
|
||||||
window = CreateWindowA("static", "ddraw_test1", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test1", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
|
||||||
if (!(ddraw7 = create_ddraw()))
|
ddraw7 = create_ddraw();
|
||||||
goto done;
|
ok(!!ddraw7, "Failed to create a ddraw object.\n");
|
||||||
/* Newly created ddraw objects restore the mode on ddraw2+::SetCooperativeLevel(NORMAL) */
|
/* Newly created ddraw objects restore the mode on ddraw2+::SetCooperativeLevel(NORMAL) */
|
||||||
restored = test_mode_restored(ddraw7, window);
|
restored = test_mode_restored(ddraw7, window);
|
||||||
ok(restored, "Display mode not restored in new ddraw object\n");
|
ok(restored, "Display mode not restored in new ddraw object\n");
|
||||||
|
@ -3240,8 +3190,8 @@ static void test_coop_level_versions(void)
|
||||||
IDirectDraw_Release(ddraw);
|
IDirectDraw_Release(ddraw);
|
||||||
IDirectDraw7_Release(ddraw7);
|
IDirectDraw7_Release(ddraw7);
|
||||||
|
|
||||||
if (!(ddraw7 = create_ddraw()))
|
ddraw7 = create_ddraw();
|
||||||
goto done;
|
ok(!!ddraw7, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw7_QueryInterface(ddraw7, &IID_IDirectDraw, (void **)&ddraw);
|
hr = IDirectDraw7_QueryInterface(ddraw7, &IID_IDirectDraw, (void **)&ddraw);
|
||||||
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -3254,8 +3204,8 @@ static void test_coop_level_versions(void)
|
||||||
IDirectDraw7_Release(ddraw7);
|
IDirectDraw7_Release(ddraw7);
|
||||||
|
|
||||||
/* A failing call does not restore the ddraw2+ behavior */
|
/* A failing call does not restore the ddraw2+ behavior */
|
||||||
if (!(ddraw7 = create_ddraw()))
|
ddraw7 = create_ddraw();
|
||||||
goto done;
|
ok(!!ddraw7, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw7_QueryInterface(ddraw7, &IID_IDirectDraw, (void **)&ddraw);
|
hr = IDirectDraw7_QueryInterface(ddraw7, &IID_IDirectDraw, (void **)&ddraw);
|
||||||
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -3270,8 +3220,8 @@ static void test_coop_level_versions(void)
|
||||||
IDirectDraw7_Release(ddraw7);
|
IDirectDraw7_Release(ddraw7);
|
||||||
|
|
||||||
/* Neither does a sequence of successful calls with the new interface */
|
/* Neither does a sequence of successful calls with the new interface */
|
||||||
if (!(ddraw7 = create_ddraw()))
|
ddraw7 = create_ddraw();
|
||||||
goto done;
|
ok(!!ddraw7, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw7_QueryInterface(ddraw7, &IID_IDirectDraw, (void **)&ddraw);
|
hr = IDirectDraw7_QueryInterface(ddraw7, &IID_IDirectDraw, (void **)&ddraw);
|
||||||
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -3288,8 +3238,8 @@ static void test_coop_level_versions(void)
|
||||||
IDirectDraw7_Release(ddraw7);
|
IDirectDraw7_Release(ddraw7);
|
||||||
|
|
||||||
/* ddraw1::CreateSurface does not triger the ddraw1 behavior */
|
/* ddraw1::CreateSurface does not triger the ddraw1 behavior */
|
||||||
if (!(ddraw7 = create_ddraw()))
|
ddraw7 = create_ddraw();
|
||||||
goto done;
|
ok(!!ddraw7, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw7_QueryInterface(ddraw7, &IID_IDirectDraw, (void **)&ddraw);
|
hr = IDirectDraw7_QueryInterface(ddraw7, &IID_IDirectDraw, (void **)&ddraw);
|
||||||
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -3309,8 +3259,6 @@ static void test_coop_level_versions(void)
|
||||||
|
|
||||||
IDirectDraw_Release(ddraw);
|
IDirectDraw_Release(ddraw);
|
||||||
IDirectDraw7_Release(ddraw7);
|
IDirectDraw7_Release(ddraw7);
|
||||||
|
|
||||||
done:
|
|
||||||
DestroyWindow(window);
|
DestroyWindow(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3643,11 +3591,8 @@ static void test_coop_level_activateapp(void)
|
||||||
DDSURFACEDESC2 ddsd;
|
DDSURFACEDESC2 ddsd;
|
||||||
IDirectDrawSurface7 *surface;
|
IDirectDrawSurface7 *surface;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
wc.lpfnWndProc = activateapp_test_proc;
|
wc.lpfnWndProc = activateapp_test_proc;
|
||||||
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
wc.lpszClassName = "ddraw_test_wndproc_wc";
|
||||||
|
@ -3797,12 +3742,8 @@ static void test_texturemanage(void)
|
||||||
DDSCAPS_SYSTEMMEMORY, 0},
|
DDSCAPS_SYSTEMMEMORY, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
ddraw = create_ddraw();
|
||||||
{
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = IDirectDraw7_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL);
|
hr = IDirectDraw7_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -4388,14 +4329,10 @@ static void test_rt_caps(void)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -4641,14 +4578,10 @@ static void test_primary_caps(void)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i)
|
for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i)
|
||||||
{
|
{
|
||||||
|
@ -4804,14 +4737,10 @@ static void test_surface_lock(void)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -5011,14 +4940,10 @@ static void test_flip(void)
|
||||||
DDBLTFX fx;
|
DDBLTFX fx;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
|
|
||||||
hr = set_display_mode(ddraw, 640, 480);
|
hr = set_display_mode(ddraw, 640, 480);
|
||||||
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
|
||||||
|
@ -5215,15 +5140,10 @@ static void test_set_surface_desc(void)
|
||||||
{DDSCAPS_PRIMARYSURFACE | DDSCAPS_SYSTEMMEMORY, 0, FALSE, "systemmemory primary"},
|
{DDSCAPS_PRIMARYSURFACE | DDSCAPS_SYSTEMMEMORY, 0, FALSE, "systemmemory primary"},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -5511,15 +5431,10 @@ static void test_user_memory_getdc(void)
|
||||||
HDC dc;
|
HDC dc;
|
||||||
unsigned int x, y;
|
unsigned int x, y;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -5606,15 +5521,10 @@ static void test_sysmem_overlay(void)
|
||||||
IDirectDrawSurface7 *surface;
|
IDirectDrawSurface7 *surface;
|
||||||
ULONG ref;
|
ULONG ref;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -5650,14 +5560,10 @@ static void test_primary_palette(void)
|
||||||
HWND window;
|
HWND window;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw7_SetDisplayMode(ddraw, 640, 480, 8, 0, 0);
|
hr = IDirectDraw7_SetDisplayMode(ddraw, 640, 480, 8, 0, 0);
|
||||||
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr);
|
||||||
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
||||||
|
@ -5756,14 +5662,10 @@ static void test_surface_attachment(void)
|
||||||
HWND window;
|
HWND window;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -5999,14 +5901,10 @@ static void test_private_data(void)
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
HWND window;
|
HWND window;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -6144,11 +6042,7 @@ static void test_pixel_format(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
ddraw = create_ddraw();
|
ddraw = create_ddraw();
|
||||||
if (!ddraw)
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
{
|
|
||||||
skip("Failed to create ddraw object\n");
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
test_format = GetPixelFormat(hdc);
|
test_format = GetPixelFormat(hdc);
|
||||||
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
|
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
|
||||||
|
@ -6278,14 +6172,10 @@ static void test_create_surface_pitch(void)
|
||||||
};
|
};
|
||||||
DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE;
|
DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE;
|
||||||
|
|
||||||
if (!(ddraw = create_ddraw()))
|
|
||||||
{
|
|
||||||
skip("Failed to create a ddraw object, skipping test.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
|
||||||
0, 0, 640, 480, 0, 0, 0, 0);
|
0, 0, 640, 480, 0, 0, 0, 0);
|
||||||
|
ddraw = create_ddraw();
|
||||||
|
ok(!!ddraw, "Failed to create a ddraw object.\n");
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
@ -6336,6 +6226,7 @@ static void test_create_surface_pitch(void)
|
||||||
START_TEST(ddraw7)
|
START_TEST(ddraw7)
|
||||||
{
|
{
|
||||||
HMODULE module = GetModuleHandleA("ddraw.dll");
|
HMODULE module = GetModuleHandleA("ddraw.dll");
|
||||||
|
IDirectDraw7 *ddraw;
|
||||||
|
|
||||||
if (!(pDirectDrawCreateEx = (void *)GetProcAddress(module, "DirectDrawCreateEx")))
|
if (!(pDirectDrawCreateEx = (void *)GetProcAddress(module, "DirectDrawCreateEx")))
|
||||||
{
|
{
|
||||||
|
@ -6343,6 +6234,13 @@ START_TEST(ddraw7)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(ddraw = create_ddraw()))
|
||||||
|
{
|
||||||
|
skip("Failed to create a ddraw object, skipping tests.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
IDirectDraw7_Release(ddraw);
|
||||||
|
|
||||||
test_process_vertices();
|
test_process_vertices();
|
||||||
test_coop_level_create_device_window();
|
test_coop_level_create_device_window();
|
||||||
test_clipper_blt();
|
test_clipper_blt();
|
||||||
|
|
Loading…
Reference in New Issue