-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraphicsD11.h
More file actions
44 lines (31 loc) · 958 Bytes
/
GraphicsD11.h
File metadata and controls
44 lines (31 loc) · 958 Bytes
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
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include "settings.h"
#include "NouWin.h"
#include <d3d11.h>
#include <dxgi1_4.h>
#include <wrl.h>
#include <d3dcompiler.h>
#include <DirectXMath.h>
#pragma comment(lib, "d3d11.lib")
#pragma comment(lib, "D3DCompiler.lib")
#pragma comment(lib, "dxgi.lib")
class GraphicsD11
{
friend class Bindable;
public:
GraphicsD11(HWND hWnd, const unsigned int width, const unsigned int height);
GraphicsD11(const GraphicsD11&) = delete;
GraphicsD11& operator=(const GraphicsD11&) = delete;
~GraphicsD11() = default;
void OnFrameEnd();
void ClearBuffer(float r, float g, float b, float a);
void DrawIndexed(UINT count);
private:
HRESULT res;
Microsoft::WRL::ComPtr <ID3D11Device> pDevice;
Microsoft::WRL::ComPtr <IDXGISwapChain> pSwap;
Microsoft::WRL::ComPtr <ID3D11DeviceContext> pContext;
Microsoft::WRL::ComPtr <ID3D11RenderTargetView> pTarget;
Microsoft::WRL::ComPtr<ID3D11DepthStencilView> pDSV;
UINT primitiveCount = 0;
};