// Copyright 2019 Dolphin Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include #include #include #include #include "Common/CommonTypes.h" #include "Common/WindowSystemInfo.h" #include "VideoBackends/D3D/D3DBase.h" #include "VideoBackends/D3DCommon/SwapChain.h" #include "VideoCommon/TextureConfig.h" namespace DX11 { class DXTexture; class DXFramebuffer; class SwapChain : public D3DCommon::SwapChain { public: SwapChain(const WindowSystemInfo& wsi, IDXGIFactory* dxgi_factory, ID3D11Device* d3d_device); ~SwapChain(); static std::unique_ptr Create(const WindowSystemInfo& wsi); DXTexture* GetTexture() const { return m_texture.get(); } DXFramebuffer* GetFramebuffer() const { return m_framebuffer.get(); } protected: bool CreateSwapChainBuffers() override; void DestroySwapChainBuffers() override; private: // The runtime takes care of renaming the buffers. std::unique_ptr m_texture; std::unique_ptr m_framebuffer; }; } // namespace DX11