Commit 0e4250c5 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

dxgi: Implement dxgi_swapchain_GetDesc1().

parent 90db63ab
......@@ -429,9 +429,37 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetLastPresentCount(IDXGISwapCha
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDesc1(IDXGISwapChain1 *iface, DXGI_SWAP_CHAIN_DESC1 *desc)
{
FIXME("iface %p, desc %p stub!\n", iface, desc);
struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain1(iface);
struct wined3d_swapchain_desc wined3d_desc;
return E_NOTIMPL;
TRACE("iface %p, desc %p.\n", iface, desc);
if (!desc)
{
WARN("Invalid pointer.\n");
return E_INVALIDARG;
}
wined3d_mutex_lock();
wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &wined3d_desc);
wined3d_mutex_unlock();
FIXME("Ignoring Stereo, BufferUsage, Scaling, SwapEffect and AlphaMode.\n");
desc->Width = wined3d_desc.backbuffer_width;
desc->Height = wined3d_desc.backbuffer_height;
desc->Format = dxgi_format_from_wined3dformat(wined3d_desc.backbuffer_format);
desc->Stereo = FALSE;
dxgi_sample_desc_from_wined3d(&desc->SampleDesc,
wined3d_desc.multisample_type, wined3d_desc.multisample_quality);
desc->BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
desc->BufferCount = wined3d_desc.backbuffer_count;
desc->Scaling = DXGI_SCALING_STRETCH;
desc->SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
desc->AlphaMode = DXGI_ALPHA_MODE_IGNORE;
desc->Flags = dxgi_swapchain_flags_from_wined3d(wined3d_desc.flags);
return S_OK;
}
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetFullscreenDesc(IDXGISwapChain1 *iface,
......
......@@ -868,6 +868,7 @@ static void test_create_swapchain(void)
struct swapchain_fullscreen_state initial_state, expected_state;
unsigned int i, expected_width, expected_height;
DXGI_SWAP_CHAIN_DESC creation_desc, result_desc;
DXGI_SWAP_CHAIN_DESC1 swapchain_desc;
IDXGIDevice *device, *bgra_device;
ULONG refcount, expected_refcount;
IUnknown *obj, *obj2, *parent;
......@@ -968,6 +969,15 @@ static void test_create_swapchain(void)
"Failed to query IDXGISwapChain1 interface, hr %#x.\n", hr);
if (SUCCEEDED(hr))
{
hr = IDXGISwapChain1_GetDesc1(swapchain1, NULL);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = IDXGISwapChain1_GetDesc1(swapchain1, &swapchain_desc);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(!swapchain_desc.Stereo, "Got unexpected stereo %#x.\n", swapchain_desc.Stereo);
ok(swapchain_desc.Scaling == DXGI_SCALING_STRETCH,
"Got unexpected scaling %#x.\n", swapchain_desc.Scaling);
ok(swapchain_desc.AlphaMode == DXGI_ALPHA_MODE_IGNORE,
"Got unexpected alpha mode %#x.\n", swapchain_desc.AlphaMode);
hr = IDXGISwapChain1_GetHwnd(swapchain1, &window);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(window == creation_desc.OutputWindow, "Got unexpected window %p.\n", window);
......
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