-
Notifications
You must be signed in to change notification settings - Fork 0
/
SwapChain.h
28 lines (26 loc) · 881 Bytes
/
SwapChain.h
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
#pragma once
#include "Renderer.h"
#include "Prerequisites.h"
class SwapChain
{
public:
SwapChain(Renderer* renderer);
bool Initialize(HWND hwnd, unsigned int width, unsigned int height, bool fullscreen);
void Present(bool vsync);
ID3D11RenderTargetView* GetRenderTargetView() const;
ID3D11DepthStencilView* GetDepthStencilView() const;
/// <summary>
/// Derecated
/// Use ComPtr instead
/// </summary>
void Release();
void ReloadBuffers(unsigned int width, unsigned int height);
void Resize(unsigned int width, unsigned int height);
void SetFullScreen(unsigned int width, unsigned int height, bool fullscreen);
~SwapChain();
private:
Microsoft::WRL::ComPtr<IDXGISwapChain> m_swapChain = nullptr;
Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_rtv = nullptr;
Microsoft::WRL::ComPtr<ID3D11DepthStencilView> m_dsv = nullptr;
Renderer* m_renderer = nullptr;
};