Commit 05b11380 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

dxgi: Implement dxgi_swapchain_GetFullscreenDesc().

parent 0e4250c5
......@@ -465,9 +465,30 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDesc1(IDXGISwapChain1 *iface,
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetFullscreenDesc(IDXGISwapChain1 *iface,
DXGI_SWAP_CHAIN_FULLSCREEN_DESC *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 ScanlineOrdering and Scaling.\n");
desc->RefreshRate.Numerator = wined3d_desc.refresh_rate;
desc->RefreshRate.Denominator = 1;
desc->ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;
desc->Scaling = DXGI_MODE_SCALING_UNSPECIFIED;
desc->Windowed = wined3d_desc.windowed;
return S_OK;
}
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetHwnd(IDXGISwapChain1 *iface, HWND *hwnd)
......
......@@ -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_FULLSCREEN_DESC fullscreen_desc;
DXGI_SWAP_CHAIN_DESC1 swapchain_desc;
IDXGIDevice *device, *bgra_device;
ULONG refcount, expected_refcount;
......@@ -978,6 +979,12 @@ static void test_create_swapchain(void)
"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_GetFullscreenDesc(swapchain1, NULL);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = IDXGISwapChain1_GetFullscreenDesc(swapchain1, &fullscreen_desc);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(fullscreen_desc.Windowed == creation_desc.Windowed,
"Got unexpected windowed %#x.\n", fullscreen_desc.Windowed);
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