Commit 9e961e1f authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

dxgi: Update to IDXGISwapChain1.

parent f99a5481
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#define COBJMACROS #define COBJMACROS
#include "initguid.h" #include "initguid.h"
#include "d3d11.h" #include "d3d11_1.h"
#include "wine/test.h" #include "wine/test.h"
static const D3D10_FEATURE_LEVEL1 d3d10_feature_levels[] = static const D3D10_FEATURE_LEVEL1 d3d10_feature_levels[] =
...@@ -164,6 +164,8 @@ static void test_create_device(void) ...@@ -164,6 +164,8 @@ static void test_create_device(void)
supported_feature_level, D3D10_1_SDK_VERSION, &swapchain_desc, &swapchain, &device); supported_feature_level, D3D10_1_SDK_VERSION, &swapchain_desc, &swapchain, &device);
ok(SUCCEEDED(hr), "D3D10CreateDeviceAndSwapChain1 failed %#x.\n", hr); ok(SUCCEEDED(hr), "D3D10CreateDeviceAndSwapChain1 failed %#x.\n", hr);
check_interface(swapchain, &IID_IDXGISwapChain1, TRUE, FALSE);
memset(&obtained_desc, 0, sizeof(obtained_desc)); memset(&obtained_desc, 0, sizeof(obtained_desc));
hr = IDXGISwapChain_GetDesc(swapchain, &obtained_desc); hr = IDXGISwapChain_GetDesc(swapchain, &obtained_desc);
ok(SUCCEEDED(hr), "GetDesc failed %#x.\n", hr); ok(SUCCEEDED(hr), "GetDesc failed %#x.\n", hr);
......
...@@ -1523,6 +1523,8 @@ static void test_create_device(void) ...@@ -1523,6 +1523,8 @@ static void test_create_device(void)
&swapchain_desc, &swapchain, &device, NULL, NULL); &swapchain_desc, &swapchain, &device, NULL, NULL);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
check_interface(swapchain, &IID_IDXGISwapChain1, TRUE, FALSE);
memset(&obtained_desc, 0, sizeof(obtained_desc)); memset(&obtained_desc, 0, sizeof(obtained_desc));
hr = IDXGISwapChain_GetDesc(swapchain, &obtained_desc); hr = IDXGISwapChain_GetDesc(swapchain, &obtained_desc);
ok(SUCCEEDED(hr), "GetDesc failed %#x.\n", hr); ok(SUCCEEDED(hr), "GetDesc failed %#x.\n", hr);
...@@ -159,7 +159,7 @@ struct dxgi_adapter *unsafe_impl_from_IDXGIAdapter1(IDXGIAdapter1 *iface) DECLSP ...@@ -159,7 +159,7 @@ struct dxgi_adapter *unsafe_impl_from_IDXGIAdapter1(IDXGIAdapter1 *iface) DECLSP
/* IDXGISwapChain */ /* IDXGISwapChain */
struct dxgi_swapchain struct dxgi_swapchain
{ {
IDXGISwapChain IDXGISwapChain_iface; IDXGISwapChain1 IDXGISwapChain1_iface;
LONG refcount; LONG refcount;
struct wined3d_private_store private_store; struct wined3d_private_store private_store;
struct wined3d_swapchain *wined3d_swapchain; struct wined3d_swapchain *wined3d_swapchain;
......
...@@ -871,6 +871,7 @@ static void test_create_swapchain(void) ...@@ -871,6 +871,7 @@ static void test_create_swapchain(void)
IDXGIDevice *device, *bgra_device; IDXGIDevice *device, *bgra_device;
ULONG refcount, expected_refcount; ULONG refcount, expected_refcount;
IUnknown *obj, *obj2, *parent; IUnknown *obj, *obj2, *parent;
IDXGISwapChain1 *swapchain1;
RECT *expected_client_rect; RECT *expected_client_rect;
IDXGISwapChain *swapchain; IDXGISwapChain *swapchain;
IDXGISurface1 *surface; IDXGISurface1 *surface;
...@@ -878,6 +879,7 @@ static void test_create_swapchain(void) ...@@ -878,6 +879,7 @@ static void test_create_swapchain(void)
IDXGIFactory *factory; IDXGIFactory *factory;
IDXGIOutput *target; IDXGIOutput *target;
BOOL fullscreen; BOOL fullscreen;
HWND window;
HRESULT hr; HRESULT hr;
const struct refresh_rates refresh_list[] = const struct refresh_rates refresh_list[] =
...@@ -955,7 +957,19 @@ static void test_create_swapchain(void) ...@@ -955,7 +957,19 @@ static void test_create_swapchain(void)
refcount = IUnknown_Release(parent); refcount = IUnknown_Release(parent);
todo_wine ok(refcount == 4, "Got unexpected refcount %u.\n", refcount); todo_wine ok(refcount == 4, "Got unexpected refcount %u.\n", refcount);
IDXGISwapChain_Release(swapchain); hr = IDXGISwapChain_QueryInterface(swapchain, &IID_IDXGISwapChain1, (void **)&swapchain1);
ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
"Failed to query IDXGISwapChain1 interface, hr %#x.\n", hr);
if (SUCCEEDED(hr))
{
hr = IDXGISwapChain1_GetHwnd(swapchain1, &window);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(window == creation_desc.OutputWindow, "Got unexpected window %p.\n", window);
IDXGISwapChain1_Release(swapchain1);
}
refcount = IDXGISwapChain_Release(swapchain);
ok(!refcount, "Swapchain has %u references left.\n", refcount);
refcount = get_refcount((IUnknown *)factory); refcount = get_refcount((IUnknown *)factory);
ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); ok(refcount == 2, "Got unexpected refcount %u.\n", refcount);
......
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