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

dxgi: Update to IDXGIFactory2.

parent e0c7d903
...@@ -69,7 +69,7 @@ static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IDXGIAdapter1 *iface) ...@@ -69,7 +69,7 @@ static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IDXGIAdapter1 *iface)
if (!refcount) if (!refcount)
{ {
wined3d_private_store_cleanup(&adapter->private_store); wined3d_private_store_cleanup(&adapter->private_store);
IDXGIFactory1_Release(&adapter->factory->IDXGIFactory1_iface); IDXGIFactory2_Release(&adapter->factory->IDXGIFactory2_iface);
HeapFree(GetProcessHeap(), 0, adapter); HeapFree(GetProcessHeap(), 0, adapter);
} }
...@@ -112,7 +112,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IDXGIAdapter1 *iface, RE ...@@ -112,7 +112,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IDXGIAdapter1 *iface, RE
TRACE("iface %p, iid %s, parent %p.\n", iface, debugstr_guid(iid), parent); TRACE("iface %p, iid %s, parent %p.\n", iface, debugstr_guid(iid), parent);
return IDXGIFactory1_QueryInterface(&adapter->factory->IDXGIFactory1_iface, iid, parent); return IDXGIFactory2_QueryInterface(&adapter->factory->IDXGIFactory2_iface, iid, parent);
} }
static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IDXGIAdapter1 *iface, static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IDXGIAdapter1 *iface,
...@@ -273,7 +273,7 @@ static void dxgi_adapter_init(struct dxgi_adapter *adapter, struct dxgi_factory ...@@ -273,7 +273,7 @@ static void dxgi_adapter_init(struct dxgi_adapter *adapter, struct dxgi_factory
wined3d_private_store_init(&adapter->private_store); wined3d_private_store_init(&adapter->private_store);
adapter->ordinal = ordinal; adapter->ordinal = ordinal;
adapter->factory = factory; adapter->factory = factory;
IDXGIFactory1_AddRef(&adapter->factory->IDXGIFactory1_iface); IDXGIFactory2_AddRef(&adapter->factory->IDXGIFactory2_iface);
} }
HRESULT dxgi_adapter_create(struct dxgi_factory *factory, UINT ordinal, struct dxgi_adapter **adapter) HRESULT dxgi_adapter_create(struct dxgi_factory *factory, UINT ordinal, struct dxgi_adapter **adapter)
......
...@@ -374,7 +374,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l ...@@ -374,7 +374,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
void *layer_base; void *layer_base;
HRESULT hr; HRESULT hr;
if (!(dxgi_factory = unsafe_impl_from_IDXGIFactory1((IDXGIFactory1 *)factory))) if (!(dxgi_factory = unsafe_impl_from_IDXGIFactory2((IDXGIFactory2 *)factory)))
{ {
WARN("This is not the factory we're looking for.\n"); WARN("This is not the factory we're looking for.\n");
return E_FAIL; return E_FAIL;
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#ifdef DXGI_INIT_GUID #ifdef DXGI_INIT_GUID
#include "initguid.h" #include "initguid.h"
#endif #endif
#include "dxgi1_6.h"
#include "wine/wined3d.h" #include "wine/wined3d.h"
#include "wine/winedxgi.h" #include "wine/winedxgi.h"
...@@ -103,7 +104,7 @@ HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store, ...@@ -103,7 +104,7 @@ HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store,
/* IDXGIFactory */ /* IDXGIFactory */
struct dxgi_factory struct dxgi_factory
{ {
IDXGIFactory1 IDXGIFactory1_iface; IDXGIFactory2 IDXGIFactory2_iface;
LONG refcount; LONG refcount;
struct wined3d_private_store private_store; struct wined3d_private_store private_store;
struct wined3d *wined3d; struct wined3d *wined3d;
...@@ -113,7 +114,7 @@ struct dxgi_factory ...@@ -113,7 +114,7 @@ struct dxgi_factory
HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended) DECLSPEC_HIDDEN; HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended) DECLSPEC_HIDDEN;
HWND dxgi_factory_get_device_window(struct dxgi_factory *factory) DECLSPEC_HIDDEN; HWND dxgi_factory_get_device_window(struct dxgi_factory *factory) DECLSPEC_HIDDEN;
struct dxgi_factory *unsafe_impl_from_IDXGIFactory1(IDXGIFactory1 *iface) DECLSPEC_HIDDEN; struct dxgi_factory *unsafe_impl_from_IDXGIFactory2(IDXGIFactory2 *iface) DECLSPEC_HIDDEN;
/* IDXGIDevice */ /* IDXGIDevice */
struct dxgi_device struct dxgi_device
......
...@@ -2337,7 +2337,6 @@ static void test_create_factory(void) ...@@ -2337,7 +2337,6 @@ static void test_create_factory(void)
iface = NULL; iface = NULL;
hr = CreateDXGIFactory(&IID_IDXGIFactory2, (void **)&iface); hr = CreateDXGIFactory(&IID_IDXGIFactory2, (void **)&iface);
todo_wine
ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
"Got unexpected hr %#x.\n", hr); "Got unexpected hr %#x.\n", hr);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
...@@ -2378,7 +2377,6 @@ static void test_create_factory(void) ...@@ -2378,7 +2377,6 @@ static void test_create_factory(void)
iface = NULL; iface = NULL;
hr = pCreateDXGIFactory1(&IID_IDXGIFactory2, (void **)&iface); hr = pCreateDXGIFactory1(&IID_IDXGIFactory2, (void **)&iface);
todo_wine
ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
"Got unexpected hr %#x.\n", hr); "Got unexpected hr %#x.\n", hr);
if (SUCCEEDED(hr)) if (SUCCEEDED(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