From deafe568d235c44c24ece57e48d5b463f399694b Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 5 Aug 2016 20:56:33 +0200 Subject: [PATCH] d3dx10: Implement D3DX10CreateDeviceAndSwapChain. Signed-off-by: Alistair Leslie-Hughes Signed-off-by: Matteo Bruni Signed-off-by: Alexandre Julliard --- dlls/d3dx10_43/d3dx10_43.spec | 2 +- dlls/d3dx10_43/d3dx10_43_main.c | 17 +++++++++++++++++ include/d3dx10core.idl | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/dlls/d3dx10_43/d3dx10_43.spec b/dlls/d3dx10_43/d3dx10_43.spec index 8c71cce2dab..7795cc8f1c7 100644 --- a/dlls/d3dx10_43/d3dx10_43.spec +++ b/dlls/d3dx10_43/d3dx10_43.spec @@ -19,7 +19,7 @@ @ stub D3DX10CreateAsyncTextureInfoProcessor(ptr ptr) @ stub D3DX10CreateAsyncTextureProcessor(ptr ptr ptr) @ stdcall D3DX10CreateDevice(ptr long long long ptr) -@ stub D3DX10CreateDeviceAndSwapChain(ptr long long long ptr ptr ptr) +@ stdcall D3DX10CreateDeviceAndSwapChain(ptr long long long ptr ptr ptr) @ stdcall D3DX10CreateEffectFromFileA(str ptr ptr str long long ptr ptr ptr ptr ptr ptr) @ stdcall D3DX10CreateEffectFromFileW(wstr ptr ptr str long long ptr ptr ptr ptr ptr ptr) @ stdcall D3DX10CreateEffectFromMemory(ptr long str ptr ptr str long long ptr ptr ptr ptr ptr ptr) diff --git a/dlls/d3dx10_43/d3dx10_43_main.c b/dlls/d3dx10_43/d3dx10_43_main.c index 3f810888472..0edb3a948b3 100644 --- a/dlls/d3dx10_43/d3dx10_43_main.c +++ b/dlls/d3dx10_43/d3dx10_43_main.c @@ -187,6 +187,23 @@ HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE drive return hr; } +HRESULT WINAPI D3DX10CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type, + HMODULE swrast, unsigned int flags, DXGI_SWAP_CHAIN_DESC *desc, IDXGISwapChain **swapchain, + ID3D10Device **device) +{ + HRESULT hr; + + TRACE("adapter %p, driver_type %d, swrast %p, flags %#x, desc %p, swapchain %p, device %p.\n", + adapter, driver_type, swrast, flags, desc, swapchain, device); + + if (SUCCEEDED(hr = D3D10CreateDeviceAndSwapChain1(adapter, driver_type, swrast, flags, D3D10_FEATURE_LEVEL_10_1, + D3D10_1_SDK_VERSION, desc, swapchain, (ID3D10Device1 **)device))) + return hr; + + return D3D10CreateDeviceAndSwapChain1(adapter, driver_type, swrast, flags, D3D10_FEATURE_LEVEL_10_0, + D3D10_1_SDK_VERSION, desc, swapchain, (ID3D10Device1 **)device); +} + HRESULT WINAPI D3DX10CreateTextureFromMemory(ID3D10Device *device, const void *src_data, SIZE_T src_data_size, D3DX10_IMAGE_LOAD_INFO *loadinfo, ID3DX10ThreadPump *pump, ID3D10Resource **texture, HRESULT *hresult) diff --git a/include/d3dx10core.idl b/include/d3dx10core.idl index 524b9ee5e5f..40d132c01e2 100644 --- a/include/d3dx10core.idl +++ b/include/d3dx10core.idl @@ -68,4 +68,7 @@ interface ID3DX10ThreadPump : IUnknown cpp_quote("HRESULT WINAPI D3DX10UnsetAllDeviceObjects(ID3D10Device *device);") cpp_quote("HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,") cpp_quote(" HMODULE swrast, unsigned int flags, ID3D10Device **device);") +cpp_quote("HRESULT WINAPI D3DX10CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,") +cpp_quote(" HMODULE swrast, unsigned int flags, DXGI_SWAP_CHAIN_DESC *desc, IDXGISwapChain **swapchain,") +cpp_quote(" ID3D10Device **device);") cpp_quote("HRESULT WINAPI D3DX10GetFeatureLevel1(ID3D10Device *device, ID3D10Device1 **device1);")