mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 03:08:19 +00:00
d3d10: Implement D3D10CreateDeviceAndSwapChain().
This commit is contained in:
parent
c7e1c0907c
commit
5d6b7e4c45
|
@ -4,7 +4,7 @@ SRCDIR = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
MODULE = d3d10.dll
|
MODULE = d3d10.dll
|
||||||
IMPORTLIB = d3d10
|
IMPORTLIB = d3d10
|
||||||
IMPORTS = dxguid uuid kernel32
|
IMPORTS = dxguid uuid dxgi kernel32
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
d3d10_main.c \
|
d3d10_main.c \
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
@ stub D3D10CompileShader
|
@ stub D3D10CompileShader
|
||||||
@ stub D3D10CreateBlob
|
@ stub D3D10CreateBlob
|
||||||
@ stdcall D3D10CreateDevice(ptr long ptr long long ptr)
|
@ stdcall D3D10CreateDevice(ptr long ptr long long ptr)
|
||||||
@ stub D3D10CreateDeviceAndSwapChain
|
@ stdcall D3D10CreateDeviceAndSwapChain(ptr long ptr long long ptr ptr ptr)
|
||||||
@ stub D3D10CreateEffectFromMemory
|
@ stub D3D10CreateEffectFromMemory
|
||||||
@ stub D3D10CreateEffectPoolFromMemory
|
@ stub D3D10CreateEffectPoolFromMemory
|
||||||
@ stub D3D10CreateStateBlock
|
@ stub D3D10CreateStateBlock
|
||||||
|
|
|
@ -64,3 +64,52 @@ HRESULT WINAPI D3D10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI D3D10CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,
|
||||||
|
HMODULE swrast, UINT flags, UINT sdk_version, DXGI_SWAP_CHAIN_DESC *swapchain_desc,
|
||||||
|
IDXGISwapChain **swapchain, ID3D10Device **device)
|
||||||
|
{
|
||||||
|
IDXGIFactory *factory;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
TRACE("adapter %p, driver_type %s, swrast %p, flags %#x, sdk_version %d,\n"
|
||||||
|
"\tswapchain_desc %p, swapchain %p, device %p\n",
|
||||||
|
adapter, debug_d3d10_driver_type(driver_type), swrast, flags, sdk_version,
|
||||||
|
swapchain_desc, swapchain, device);
|
||||||
|
|
||||||
|
hr = D3D10CreateDevice(adapter, driver_type, swrast, flags, sdk_version, device);
|
||||||
|
if (FAILED(hr))
|
||||||
|
{
|
||||||
|
WARN("Failed to create a device, returning %#x\n", hr);
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
|
TRACE("Created ID3D10Device %p\n", *device);
|
||||||
|
|
||||||
|
hr = CreateDXGIFactory(&IID_IDXGIFactory, (void **)&factory);
|
||||||
|
if (FAILED(hr))
|
||||||
|
{
|
||||||
|
ID3D10Device_Release(*device);
|
||||||
|
*device = NULL;
|
||||||
|
|
||||||
|
WARN("Failed to create a DXGI factory, returning %#x\n", hr);
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
|
TRACE("Created IDXGIFactory %p\n", factory);
|
||||||
|
|
||||||
|
hr = IDXGIFactory_CreateSwapChain(factory, (IUnknown *)*device, swapchain_desc, swapchain);
|
||||||
|
IDXGIFactory_Release(factory);
|
||||||
|
if (FAILED(hr))
|
||||||
|
{
|
||||||
|
ID3D10Device_Release(*device);
|
||||||
|
*device = NULL;
|
||||||
|
|
||||||
|
WARN("Failed to create a swapchain, returning %#x\n", hr);
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
|
TRACE("Created IDXGISwapChain %p\n", *swapchain);
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
|
@ -35,6 +35,10 @@ typedef enum D3D10_DRIVER_TYPE {
|
||||||
HRESULT WINAPI D3D10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,
|
HRESULT WINAPI D3D10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,
|
||||||
HMODULE swrast, UINT flags, UINT sdk_version, ID3D10Device **device);
|
HMODULE swrast, UINT flags, UINT sdk_version, ID3D10Device **device);
|
||||||
|
|
||||||
|
HRESULT WINAPI D3D10CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,
|
||||||
|
HMODULE swrast, UINT flags, UINT sdk_version, DXGI_SWAP_CHAIN_DESC *swapchain_desc,
|
||||||
|
IDXGISwapChain **swapchain, ID3D10Device **device);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue