D3DSwapChain.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2019 Dolphin Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <d3d11.h>
  5. #include <dxgi.h>
  6. #include <memory>
  7. #include <vector>
  8. #include "Common/CommonTypes.h"
  9. #include "Common/WindowSystemInfo.h"
  10. #include "VideoBackends/D3D/D3DBase.h"
  11. #include "VideoBackends/D3DCommon/SwapChain.h"
  12. #include "VideoCommon/TextureConfig.h"
  13. namespace DX11
  14. {
  15. class DXTexture;
  16. class DXFramebuffer;
  17. class SwapChain : public D3DCommon::SwapChain
  18. {
  19. public:
  20. SwapChain(const WindowSystemInfo& wsi, IDXGIFactory* dxgi_factory, ID3D11Device* d3d_device);
  21. ~SwapChain();
  22. static std::unique_ptr<SwapChain> Create(const WindowSystemInfo& wsi);
  23. DXTexture* GetTexture() const { return m_texture.get(); }
  24. DXFramebuffer* GetFramebuffer() const { return m_framebuffer.get(); }
  25. protected:
  26. bool CreateSwapChainBuffers() override;
  27. void DestroySwapChainBuffers() override;
  28. private:
  29. // The runtime takes care of renaming the buffers.
  30. std::unique_ptr<DXTexture> m_texture;
  31. std::unique_ptr<DXFramebuffer> m_framebuffer;
  32. };
  33. } // namespace DX11