dxgi: Implement dxgi_swapchain_SetFullscreenState().

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2016-08-03 09:41:41 +02:00 committed by Alexandre Julliard
parent f586cc98a0
commit bbc2d604ce
2 changed files with 39 additions and 5 deletions

View File

@ -204,9 +204,43 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetBuffer(IDXGISwapChain *iface,
static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH dxgi_swapchain_SetFullscreenState(IDXGISwapChain *iface,
BOOL fullscreen, IDXGIOutput *target)
{
FIXME("iface %p, fullscreen %#x, target %p stub!\n", iface, fullscreen, target);
struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface);
struct wined3d_swapchain_desc swapchain_desc;
HRESULT hr;
return E_NOTIMPL;
TRACE("iface %p, fullscreen %#x, target %p.\n", iface, fullscreen, target);
if (!fullscreen && target)
{
WARN("Invalid call.\n");
return DXGI_ERROR_INVALID_CALL;
}
if (fullscreen)
{
if (target)
{
IDXGIOutput_AddRef(target);
}
else if (FAILED(hr = IDXGISwapChain_GetContainingOutput(iface, &target)))
{
WARN("Failed to get default target output for swapchain, hr %#x.\n", hr);
return hr;
}
}
swapchain->fullscreen = fullscreen;
if (swapchain->target)
IDXGIOutput_Release(swapchain->target);
swapchain->target = target;
wined3d_mutex_lock();
wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &swapchain_desc);
swapchain_desc.windowed = !fullscreen;
hr = wined3d_swapchain_set_fullscreen(swapchain->wined3d_swapchain, &swapchain_desc, NULL);
wined3d_mutex_unlock();
return hr;
}
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetFullscreenState(IDXGISwapChain *iface,

View File

@ -545,7 +545,7 @@ static void test_create_swapchain(void)
"Denominator %u is %u.\n", i ,result_desc.BufferDesc.RefreshRate.Denominator);
hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL);
todo_wine ok(SUCCEEDED(hr), "SetFullscreenState failed, hr %#x.\n", hr);
ok(SUCCEEDED(hr), "SetFullscreenState failed, hr %#x.\n", hr);
IDXGISwapChain_Release(swapchain);
}
@ -1301,7 +1301,7 @@ static void test_swapchain_parameters(void)
if (FAILED(hr))
{
hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL);
todo_wine ok(SUCCEEDED(hr), "SetFullscreenState failed, hr %#x.\n", hr);
ok(SUCCEEDED(hr), "SetFullscreenState failed, hr %#x.\n", hr);
IDXGISwapChain_Release(swapchain);
continue;
@ -1357,7 +1357,7 @@ static void test_swapchain_parameters(void)
ok(hr == DXGI_ERROR_INVALID_CALL, "GetBuffer(%u) returned unexpected hr %#x, test %u.\n", j, hr, i);
hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL);
todo_wine ok(SUCCEEDED(hr), "SetFullscreenState failed, hr %#x.\n", hr);
ok(SUCCEEDED(hr), "SetFullscreenState failed, hr %#x.\n", hr);
IDXGISwapChain_Release(swapchain);
}