D3D: Make the global swapchain static again.

This commit is contained in:
Jules Blok
2014-07-26 13:00:49 +02:00
parent 6724ce6275
commit 06b13f12d3
3 changed files with 26 additions and 6 deletions

View File

@ -31,7 +31,7 @@ namespace D3D
ID3D11Device* device = nullptr;
ID3D11DeviceContext* context = nullptr;
IDXGISwapChain* swapchain = nullptr;
static IDXGISwapChain* swapchain = nullptr;
D3D_FEATURE_LEVEL featlevel;
D3DTexture2D* backbuf = nullptr;
HWND hWnd;
@ -492,6 +492,24 @@ void Present()
swapchain->Present((UINT)g_ActiveConfig.IsVSync(), 0);
}
HRESULT SetFullscreenState(bool enable_fullscreen)
{
return swapchain->SetFullscreenState(enable_fullscreen, nullptr);
}
HRESULT GetFullscreenState(bool* fullscreen_state)
{
if (fullscreen_state == nullptr)
{
return E_POINTER;
}
BOOL state;
HRESULT hr = swapchain->GetFullscreenState(&state, nullptr);
*fullscreen_state = !!state;
return hr;
}
} // namespace D3D
} // namespace DX11