Commit 9d29be28 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

d3d8/tests: Test D3DBACKBUFFER_TYPE.

parent 2e8e2da5
......@@ -257,7 +257,7 @@ static void test_swapchain(void)
IDirect3DSwapChain8 *swapchain1;
IDirect3DSwapChain8 *swapchain2;
IDirect3DSwapChain8 *swapchain3;
IDirect3DSurface8 *backbuffer;
IDirect3DSurface8 *backbuffer, *stereo_buffer;
D3DPRESENT_PARAMETERS d3dpp;
IDirect3DDevice8 *device;
IDirect3D8 *d3d;
......@@ -286,6 +286,24 @@ static void test_swapchain(void)
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
ok(!backbuffer, "The back buffer pointer is %p, expected NULL.\n", backbuffer);
hr = IDirect3DDevice8_GetBackBuffer(device, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer);
ok(SUCCEEDED(hr), "Failed to get back buffer, hr %#x.\n", hr);
IDirect3DSurface8_Release(backbuffer);
/* The back buffer type value is ignored. */
hr = IDirect3DDevice8_GetBackBuffer(device, 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);
IDirect3DSurface8_Release(stereo_buffer);
hr = IDirect3DDevice8_GetBackBuffer(device, 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);
IDirect3DSurface8_Release(stereo_buffer);
hr = IDirect3DDevice8_GetBackBuffer(device, 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);
IDirect3DSurface8_Release(stereo_buffer);
memset(&d3dpp, 0, sizeof(d3dpp));
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
......@@ -315,6 +333,20 @@ static void test_swapchain(void)
ok(backbuffer != NULL && backbuffer != (void *) 0xdeadbeef, "The back buffer is %p\n", backbuffer);
if(backbuffer && backbuffer != (void *) 0xdeadbeef) IDirect3DSurface8_Release(backbuffer);
/* The back buffer type value is ignored. */
hr = IDirect3DSwapChain8_GetBackBuffer(swapchain3, 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);
IDirect3DSurface8_Release(stereo_buffer);
hr = IDirect3DSwapChain8_GetBackBuffer(swapchain3, 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);
IDirect3DSurface8_Release(stereo_buffer);
hr = IDirect3DSwapChain8_GetBackBuffer(swapchain3, 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);
IDirect3DSurface8_Release(stereo_buffer);
backbuffer = (void *) 0xdeadbeef;
hr = IDirect3DSwapChain8_GetBackBuffer(swapchain3, 1, 0, &backbuffer);
ok(SUCCEEDED(hr), "Failed to get the 2nd back buffer (%#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