Commit f805fb11 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

dxgi/tests: Test presentation parameter combinations.

parent 142bcb5d
......@@ -190,21 +190,43 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IDXGIFactory1 *ifa
struct wined3d_swapchain_desc wined3d_desc;
IWineDXGIDevice *dxgi_device;
HRESULT hr;
UINT min_buffer_count;
FIXME("iface %p, device %p, desc %p, swapchain %p partial stub!\n", iface, device, desc, swapchain);
hr = IUnknown_QueryInterface(device, &IID_IWineDXGIDevice, (void **)&dxgi_device);
if (FAILED(hr))
switch (desc->SwapEffect)
{
ERR("This is not the device we're looking for\n");
return hr;
case DXGI_SWAP_EFFECT_DISCARD:
case DXGI_SWAP_EFFECT_SEQUENTIAL:
min_buffer_count = 1;
break;
case DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL:
min_buffer_count = 2;
break;
default:
WARN("Invalid swap effect %u used, returning DXGI_ERROR_INVALID_CALL.\n", desc->SwapEffect);
return DXGI_ERROR_INVALID_CALL;
}
if (desc->BufferCount < min_buffer_count || desc->BufferCount > 16)
{
WARN("BufferCount is %u, returning DXGI_ERROR_INVALID_CALL.\n", desc->BufferCount);
return DXGI_ERROR_INVALID_CALL;
}
if (!desc->OutputWindow)
{
FIXME("No output window, should use factory output window\n");
}
hr = IUnknown_QueryInterface(device, &IID_IWineDXGIDevice, (void **)&dxgi_device);
if (FAILED(hr))
{
ERR("This is not the device we're looking for\n");
return hr;
}
FIXME("Ignoring SwapEffect and Flags\n");
wined3d_desc.backbuffer_width = desc->BufferDesc.Width;
......
......@@ -60,6 +60,8 @@ const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT = 0x20L;
const DXGI_USAGE DXGI_USAGE_BACK_BUFFER = 0x40L;
const DXGI_USAGE DXGI_USAGE_SHARED = 0x80L;
const DXGI_USAGE DXGI_USAGE_READ_ONLY = 0x100L;
const DXGI_USAGE DXGI_USAGE_DISCARD_ON_PRESENT = 0x200L;
const DXGI_USAGE DXGI_USAGE_UNORDERED_ACCESS = 0x400L;
const UINT DXGI_ENUM_MODES_INTERLACED = 1;
const UINT DXGI_ENUM_MODES_SCALING = 2;
......
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