Commit 2e8e2da5 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

d3d9/tests: Test D3DBACKBUFFER_TYPE.

parent b55e599a
......@@ -1053,7 +1053,7 @@ static void test_swapchain(void)
IDirect3DSwapChain9 *swapchain2;
IDirect3DSwapChain9 *swapchain3;
IDirect3DSwapChain9 *swapchainX;
IDirect3DSurface9 *backbuffer;
IDirect3DSurface9 *backbuffer, *stereo_buffer;
D3DPRESENT_PARAMETERS d3dpp;
IDirect3DDevice9 *device;
IDirect3D9 *d3d;
......@@ -1103,6 +1103,33 @@ static void test_swapchain(void)
ok(backbuffer != NULL, "The back buffer is NULL\n");
if(backbuffer) IDirect3DSurface9_Release(backbuffer);
/* The back buffer type value is ignored. */
hr = IDirect3DSwapChain9_GetBackBuffer(swapchain0, 0, D3DBACKBUFFER_TYPE_LEFT, &stereo_buffer);
ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr);
ok(stereo_buffer == backbuffer, "Expected left back buffer = %p, got %p.\n", backbuffer, stereo_buffer);
IDirect3DSurface9_Release(stereo_buffer);
hr = IDirect3DSwapChain9_GetBackBuffer(swapchain0, 0, D3DBACKBUFFER_TYPE_RIGHT, &stereo_buffer);
ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr);
ok(stereo_buffer == backbuffer, "Expected right back buffer = %p, got %p.\n", backbuffer, stereo_buffer);
IDirect3DSurface9_Release(stereo_buffer);
hr = IDirect3DSwapChain9_GetBackBuffer(swapchain0, 0, (D3DBACKBUFFER_TYPE)0xdeadbeef, &stereo_buffer);
ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr);
ok(stereo_buffer == backbuffer, "Expected unknown buffer = %p, got %p.\n", backbuffer, stereo_buffer);
IDirect3DSurface9_Release(stereo_buffer);
hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, D3DBACKBUFFER_TYPE_LEFT, &stereo_buffer);
ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr);
ok(stereo_buffer == backbuffer, "Expected left back buffer = %p, got %p.\n", backbuffer, stereo_buffer);
IDirect3DSurface9_Release(stereo_buffer);
hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, D3DBACKBUFFER_TYPE_RIGHT, &stereo_buffer);
ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr);
ok(stereo_buffer == backbuffer, "Expected right back buffer = %p, got %p.\n", backbuffer, stereo_buffer);
IDirect3DSurface9_Release(stereo_buffer);
hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, (D3DBACKBUFFER_TYPE)0xdeadbeef, &stereo_buffer);
ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr);
ok(stereo_buffer == backbuffer, "Expected unknown buffer = %p, got %p.\n", backbuffer, stereo_buffer);
IDirect3DSurface9_Release(stereo_buffer);
/* Try to get a nonexistent swapchain */
hr = IDirect3DDevice9_GetSwapChain(device, 1, &swapchainX);
ok(hr == D3DERR_INVALIDCALL, "GetSwapChain on an nonexistent swapchain returned (%08x)\n", hr);
......
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