Commit 7170a202 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

dxgi: Add a separate function for dxgi_adapter initialization.

parent fa07d937
...@@ -142,7 +142,7 @@ static UINT STDMETHODCALLTYPE dxgi_adapter_get_ordinal(IWineDXGIAdapter *iface) ...@@ -142,7 +142,7 @@ static UINT STDMETHODCALLTYPE dxgi_adapter_get_ordinal(IWineDXGIAdapter *iface)
return This->ordinal; return This->ordinal;
} }
const struct IWineDXGIAdapterVtbl dxgi_adapter_vtbl = static const struct IWineDXGIAdapterVtbl dxgi_adapter_vtbl =
{ {
/* IUnknown methods */ /* IUnknown methods */
dxgi_adapter_QueryInterface, dxgi_adapter_QueryInterface,
...@@ -160,3 +160,11 @@ const struct IWineDXGIAdapterVtbl dxgi_adapter_vtbl = ...@@ -160,3 +160,11 @@ const struct IWineDXGIAdapterVtbl dxgi_adapter_vtbl =
/* IWineDXGIAdapter methods */ /* IWineDXGIAdapter methods */
dxgi_adapter_get_ordinal, dxgi_adapter_get_ordinal,
}; };
void dxgi_adapter_init(struct dxgi_adapter *adapter, IDXGIFactory *parent, UINT ordinal)
{
adapter->vtbl = &dxgi_adapter_vtbl;
adapter->parent = parent;
adapter->refcount = 1;
adapter->ordinal = ordinal;
}
...@@ -129,10 +129,7 @@ HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **factory) ...@@ -129,10 +129,7 @@ HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **factory)
goto fail; goto fail;
} }
adapter->vtbl = &dxgi_adapter_vtbl; dxgi_adapter_init(adapter, (IDXGIFactory *)object, i);
adapter->refcount = 1;
adapter->ordinal = i;
adapter->parent = (IDXGIFactory *)object;
object->adapters[i] = (IDXGIAdapter *)adapter; object->adapters[i] = (IDXGIAdapter *)adapter;
} }
......
...@@ -64,7 +64,6 @@ struct dxgi_device ...@@ -64,7 +64,6 @@ struct dxgi_device
}; };
/* IDXGIAdapter */ /* IDXGIAdapter */
extern const struct IWineDXGIAdapterVtbl dxgi_adapter_vtbl;
struct dxgi_adapter struct dxgi_adapter
{ {
const struct IWineDXGIAdapterVtbl *vtbl; const struct IWineDXGIAdapterVtbl *vtbl;
...@@ -73,6 +72,8 @@ struct dxgi_adapter ...@@ -73,6 +72,8 @@ struct dxgi_adapter
UINT ordinal; UINT ordinal;
}; };
void dxgi_adapter_init(struct dxgi_adapter *adapter, IDXGIFactory *parent, UINT ordinal);
/* IDXGISwapChain */ /* IDXGISwapChain */
extern const struct IDXGISwapChainVtbl dxgi_swapchain_vtbl; extern const struct IDXGISwapChainVtbl dxgi_swapchain_vtbl;
struct dxgi_swapchain struct dxgi_swapchain
......
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