Commit 45ea10c7 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

d3d9/tests: Test the presentation parameters after creating a device.

parent beefff00
...@@ -3686,6 +3686,7 @@ static void test_swapchain_parameters(void) ...@@ -3686,6 +3686,7 @@ static void test_swapchain_parameters(void)
{ {
IDirect3DDevice9Ex *device; IDirect3DDevice9Ex *device;
IDirect3D9Ex *d3d9ex; IDirect3D9Ex *d3d9ex;
RECT client_rect;
HWND window; HWND window;
HRESULT hr; HRESULT hr;
unsigned int i; unsigned int i;
...@@ -3837,6 +3838,39 @@ static void test_swapchain_parameters(void) ...@@ -3837,6 +3838,39 @@ static void test_swapchain_parameters(void)
IDirect3DDevice9Ex_Release(device); IDirect3DDevice9Ex_Release(device);
} }
memset(&present_parameters, 0, sizeof(present_parameters));
present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
present_parameters.Windowed = TRUE;
present_parameters.BackBufferWidth = 0;
present_parameters.BackBufferHeight = 0;
present_parameters.BackBufferFormat = D3DFMT_UNKNOWN;
GetClientRect(window, &client_rect);
hr = IDirect3D9Ex_CreateDeviceEx(d3d9ex, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
window, D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&present_parameters, NULL, &device);
todo_wine ok(present_parameters.BackBufferWidth == client_rect.right, "Got unexpected BackBufferWidth %u, expected %ld.\n",
present_parameters.BackBufferWidth, client_rect.right);
todo_wine ok(present_parameters.BackBufferHeight == client_rect.bottom, "Got unexpected BackBufferHeight %u, expected %ld.\n",
present_parameters.BackBufferHeight, client_rect.bottom);
todo_wine ok(present_parameters.BackBufferFormat != D3DFMT_UNKNOWN, "Got unexpected BackBufferFormat %#x.\n",
present_parameters.BackBufferFormat);
ok(present_parameters.BackBufferCount == 1, "Got unexpected BackBufferCount %u.\n", present_parameters.BackBufferCount);
ok(!present_parameters.MultiSampleType, "Got unexpected MultiSampleType %u.\n", present_parameters.MultiSampleType);
ok(!present_parameters.MultiSampleQuality, "Got unexpected MultiSampleQuality %lu.\n", present_parameters.MultiSampleQuality);
ok(present_parameters.SwapEffect == D3DSWAPEFFECT_DISCARD, "Got unexpected SwapEffect %#x.\n", present_parameters.SwapEffect);
ok(!present_parameters.hDeviceWindow, "Got unexpected hDeviceWindow %p.\n", present_parameters.hDeviceWindow);
ok(present_parameters.Windowed, "Got unexpected Windowed %#x.\n", present_parameters.Windowed);
ok(!present_parameters.EnableAutoDepthStencil, "Got unexpected EnableAutoDepthStencil %#x.\n", present_parameters.EnableAutoDepthStencil);
ok(!present_parameters.AutoDepthStencilFormat, "Got unexpected AutoDepthStencilFormat %#x.\n", present_parameters.AutoDepthStencilFormat);
ok(!present_parameters.Flags, "Got unexpected Flags %#lx.\n", present_parameters.Flags);
ok(!present_parameters.FullScreen_RefreshRateInHz, "Got unexpected FullScreen_RefreshRateInHz %u.\n",
present_parameters.FullScreen_RefreshRateInHz);
ok(!present_parameters.PresentationInterval, "Got unexpected PresentationInterval %#x.\n", present_parameters.PresentationInterval);
IDirect3DDevice9Ex_Release(device);
IDirect3D9Ex_Release(d3d9ex); IDirect3D9Ex_Release(d3d9ex);
DestroyWindow(window); DestroyWindow(window);
} }
......
...@@ -12296,6 +12296,7 @@ static void test_swapchain_parameters(void) ...@@ -12296,6 +12296,7 @@ static void test_swapchain_parameters(void)
{ {
IDirect3DDevice9 *device; IDirect3DDevice9 *device;
HRESULT hr, expected_hr; HRESULT hr, expected_hr;
RECT client_rect;
IDirect3D9 *d3d; IDirect3D9 *d3d;
D3DCAPS9 caps; D3DCAPS9 caps;
HWND window; HWND window;
...@@ -12493,6 +12494,40 @@ static void test_swapchain_parameters(void) ...@@ -12493,6 +12494,40 @@ static void test_swapchain_parameters(void)
IDirect3DDevice9_Release(device); IDirect3DDevice9_Release(device);
} }
memset(&present_parameters, 0, sizeof(present_parameters));
present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
present_parameters.Windowed = TRUE;
present_parameters.BackBufferWidth = 0;
present_parameters.BackBufferHeight = 0;
present_parameters.BackBufferFormat = D3DFMT_UNKNOWN;
GetClientRect(window, &client_rect);
hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
window, D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&present_parameters, &device);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine ok(present_parameters.BackBufferWidth == client_rect.right, "Got unexpected BackBufferWidth %u, expected %ld.\n",
present_parameters.BackBufferWidth, client_rect.right);
todo_wine ok(present_parameters.BackBufferHeight == client_rect.bottom, "Got unexpected BackBufferHeight %u, expected %ld.\n",
present_parameters.BackBufferHeight, client_rect.bottom);
todo_wine ok(present_parameters.BackBufferFormat != D3DFMT_UNKNOWN, "Got unexpected BackBufferFormat %#x.\n",
present_parameters.BackBufferFormat);
ok(present_parameters.BackBufferCount == 1, "Got unexpected BackBufferCount %u.\n", present_parameters.BackBufferCount);
ok(!present_parameters.MultiSampleType, "Got unexpected MultiSampleType %u.\n", present_parameters.MultiSampleType);
ok(!present_parameters.MultiSampleQuality, "Got unexpected MultiSampleQuality %lu.\n", present_parameters.MultiSampleQuality);
ok(present_parameters.SwapEffect == D3DSWAPEFFECT_DISCARD, "Got unexpected SwapEffect %#x.\n", present_parameters.SwapEffect);
ok(!present_parameters.hDeviceWindow, "Got unexpected hDeviceWindow %p.\n", present_parameters.hDeviceWindow);
ok(present_parameters.Windowed, "Got unexpected Windowed %#x.\n", present_parameters.Windowed);
ok(!present_parameters.EnableAutoDepthStencil, "Got unexpected EnableAutoDepthStencil %#x.\n", present_parameters.EnableAutoDepthStencil);
ok(!present_parameters.AutoDepthStencilFormat, "Got unexpected AutoDepthStencilFormat %#x.\n", present_parameters.AutoDepthStencilFormat);
ok(!present_parameters.Flags, "Got unexpected Flags %#lx.\n", present_parameters.Flags);
ok(!present_parameters.FullScreen_RefreshRateInHz, "Got unexpected FullScreen_RefreshRateInHz %u.\n",
present_parameters.FullScreen_RefreshRateInHz);
ok(!present_parameters.PresentationInterval, "Got unexpected PresentationInterval %#x.\n", present_parameters.PresentationInterval);
IDirect3DDevice9_Release(device);
IDirect3D9_Release(d3d); IDirect3D9_Release(d3d);
DestroyWindow(window); DestroyWindow(window);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment