[PATCH] dxgi: Implement IDXGISwapChain GetFullscreenState
Alistair Leslie-Hughes
leslie_alistair at hotmail.com
Mon Jul 11 05:08:37 CDT 2016
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
dlls/dxgi/swapchain.c | 24 ++++++++++++++++--------
dlls/dxgi/tests/device.c | 18 ++++++++++++++++++
2 files changed, 34 insertions(+), 8 deletions(-)
diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c
index 921fcdf..5c0ff61 100644
--- a/dlls/dxgi/swapchain.c
+++ b/dlls/dxgi/swapchain.c
@@ -209,14 +209,6 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH dxgi_swapchain_SetFullscreenS
return E_NOTIMPL;
}
-static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetFullscreenState(IDXGISwapChain *iface,
- BOOL *fullscreen, IDXGIOutput **target)
-{
- FIXME("iface %p, fullscreen %p, target %p stub!\n", iface, fullscreen, target);
-
- return E_NOTIMPL;
-}
-
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDesc(IDXGISwapChain *iface, DXGI_SWAP_CHAIN_DESC *desc)
{
struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface);
@@ -326,6 +318,22 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetContainingOutput(IDXGISwapCha
return hr;
}
+static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetFullscreenState(IDXGISwapChain *iface,
+ BOOL *fullscreen, IDXGIOutput **target)
+{
+ HRESULT hr = S_OK;
+
+ TRACE("iface %p, fullscreen %p, target %p semi-stub.\n", iface, fullscreen, target);
+
+ if (fullscreen)
+ *fullscreen = TRUE;
+
+ if (target)
+ hr = dxgi_swapchain_GetContainingOutput(iface, target);
+
+ return hr;
+}
+
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetFrameStatistics(IDXGISwapChain *iface, DXGI_FRAME_STATISTICS *stats)
{
FIXME("iface %p, stats %p stub!\n", iface, stats);
diff --git a/dlls/dxgi/tests/device.c b/dlls/dxgi/tests/device.c
index 3c43895..93297b8 100644
--- a/dlls/dxgi/tests/device.c
+++ b/dlls/dxgi/tests/device.c
@@ -421,8 +421,10 @@ static void test_create_swapchain(void)
IDXGIAdapter *adapter;
IDXGIFactory *factory;
IDXGIDevice *device;
+ IDXGIOutput *target = NULL;
HRESULT hr;
UINT i;
+ BOOL fullscreen;
const struct refresh_rates refresh_list[] =
{
@@ -496,6 +498,22 @@ static void test_create_swapchain(void)
refcount = IUnknown_Release(parent);
todo_wine ok(refcount == 4, "Got unexpected refcount %u.\n", refcount);
+ hr = IDXGISwapChain_GetFullscreenState(swapchain, NULL, NULL);
+ ok(hr == S_OK, "GetFullscreenState failed, hr %#x.\n", hr);
+
+ hr = IDXGISwapChain_GetFullscreenState(swapchain, &fullscreen, NULL);
+ ok(hr == S_OK, "GetFullscreenState failed, hr %#x.\n", hr);
+
+ hr = IDXGISwapChain_GetFullscreenState(swapchain, NULL, &target);
+ ok(hr == S_OK, "GetFullscreenState failed, hr %#x.\n", hr);
+ if(target)
+ IDXGIOutput_Release(target);
+
+ hr = IDXGISwapChain_GetFullscreenState(swapchain, &fullscreen, &target);
+ ok(hr == S_OK, "GetFullscreenState failed, hr %#x.\n", hr);
+ if(target)
+ IDXGIOutput_Release(target);
+
IDXGISwapChain_Release(swapchain);
refcount = get_refcount((IUnknown *)factory);
--
1.9.1
More information about the wine-patches
mailing list