summaryrefslogtreecommitdiffstats
path: root/tools/gfx/d3d11/d3d11-swap-chain.h
blob: a8b8fe0337bf69a602d7de40ad08a3f24592ce3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// d3d11-swap-chain.h
#pragma once

#include "d3d11-base.h"

namespace gfx
{

using namespace Slang;

namespace d3d11
{

class SwapchainImpl : public D3DSwapchainBase
{
public:
    ComPtr<ID3D11Device> m_device;
    ComPtr<IDXGIFactory> m_dxgiFactory;
    RefPtr<DeviceImpl> m_renderer;
    Result init(DeviceImpl* renderer, const ISwapchain::Desc& swapchainDesc, WindowHandle window);

    virtual void createSwapchainBufferImages() override;
    virtual IDXGIFactory* getDXGIFactory() override { return m_dxgiFactory; }
    virtual IUnknown* getOwningDevice() override { return m_device; }
    virtual SLANG_NO_THROW Result SLANG_MCALL resize(GfxCount width, GfxCount height) override;
    virtual SLANG_NO_THROW bool SLANG_MCALL isOccluded() override;
    virtual SLANG_NO_THROW Result SLANG_MCALL setFullScreenMode(bool mode) override;
};

} // namespace d3d11
} // namespace gfx