From 3d28b01916cf83461ee36325bb555b3f0771e792 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 28 Jan 2014 10:09:26 +0100 Subject: [PATCH] dxgi: Implement IDXGIFactory1. --- dlls/dxgi/factory.c | 34 +++++++++++++++++++++++++++------- include/wine/winedxgi.idl | 2 +- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index e0aa0359564..18a9a81a550 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -38,6 +38,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_QueryInterface(IWineDXGIFactory *i if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDXGIObject) || IsEqualGUID(riid, &IID_IDXGIFactory) + || IsEqualGUID(riid, &IID_IDXGIFactory1) || IsEqualGUID(riid, &IID_IWineDXGIFactory)) { IUnknown_AddRef(iface); @@ -124,29 +125,38 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_GetParent(IWineDXGIFactory *iface, /* IDXGIFactory methods */ -static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IWineDXGIFactory *iface, - UINT adapter_idx, IDXGIAdapter **adapter) +static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters1(IWineDXGIFactory *iface, + UINT adapter_idx, IDXGIAdapter1 **adapter) { - struct dxgi_factory *This = impl_from_IWineDXGIFactory(iface); + struct dxgi_factory *factory = impl_from_IWineDXGIFactory(iface); TRACE("iface %p, adapter_idx %u, adapter %p\n", iface, adapter_idx, adapter); - if (!adapter) return DXGI_ERROR_INVALID_CALL; + if (!adapter) + return DXGI_ERROR_INVALID_CALL; - if (adapter_idx >= This->adapter_count) + if (adapter_idx >= factory->adapter_count) { *adapter = NULL; return DXGI_ERROR_NOT_FOUND; } - *adapter = (IDXGIAdapter *)This->adapters[adapter_idx]; - IDXGIAdapter_AddRef(*adapter); + *adapter = (IDXGIAdapter1 *)factory->adapters[adapter_idx]; + IDXGIAdapter1_AddRef(*adapter); TRACE("Returning adapter %p\n", *adapter); return S_OK; } +static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IWineDXGIFactory *iface, + UINT adapter_idx, IDXGIAdapter **adapter) +{ + TRACE("iface %p, adapter_idx %u, adapter %p\n", iface, adapter_idx, adapter); + + return dxgi_factory_EnumAdapters1(iface, adapter_idx, (IDXGIAdapter1 **)adapter); +} + static HRESULT STDMETHODCALLTYPE dxgi_factory_MakeWindowAssociation(IWineDXGIFactory *iface, HWND window, UINT flags) { FIXME("iface %p, window %p, flags %#x stub!\n\n", iface, window, flags); @@ -263,6 +273,13 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSoftwareAdapter(IWineDXGIFac return E_NOTIMPL; } +static BOOL STDMETHODCALLTYPE dxgi_factory_IsCurrent(IWineDXGIFactory *iface) +{ + FIXME("iface %p stub!\n", iface); + + return TRUE; +} + /* IWineDXGIFactory methods */ static struct wined3d * STDMETHODCALLTYPE dxgi_factory_get_wined3d(IWineDXGIFactory *iface) @@ -294,6 +311,9 @@ static const struct IWineDXGIFactoryVtbl dxgi_factory_vtbl = dxgi_factory_GetWindowAssociation, dxgi_factory_CreateSwapChain, dxgi_factory_CreateSoftwareAdapter, + /* IDXGIFactory1 methods */ + dxgi_factory_EnumAdapters1, + dxgi_factory_IsCurrent, /* IWineDXGIFactory methods */ dxgi_factory_get_wined3d, }; diff --git a/include/wine/winedxgi.idl b/include/wine/winedxgi.idl index a3baece97b2..26f29e385fd 100644 --- a/include/wine/winedxgi.idl +++ b/include/wine/winedxgi.idl @@ -23,7 +23,7 @@ import "dxgi.idl"; local, uuid(a07ad9ab-fb01-4574-8bfb-0a70a7373f04) ] -interface IWineDXGIFactory : IDXGIFactory +interface IWineDXGIFactory : IDXGIFactory1 { struct wined3d *get_wined3d(); }