-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDXRender.hpp
47 lines (32 loc) · 967 Bytes
/
DXRender.hpp
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
44
45
46
47
#pragma once
#include <stdio.h>
#include <d3d11.h>
#include <d3dcompiler.h>
#pragma comment(lib, "d3d11.lib")
#pragma comment(lib, "d3dcompiler.lib")
class DXRender
{
public:
HRESULT Init(HWND hWnd, bool vsync);
void Cleanup();
void RenderStart();
void RenderEnd();
ID3D11Device *GetDevice();
ID3D11DeviceContext *GetDeviceContext();
HRESULT ChangeRasterizerStateToWireframe();
HRESULT ChangeRasterizerStateToSolid();
private:
void InitViewport(HWND hWnd);
HRESULT CreateBackBuffer();
HRESULT CreateDepthStencil(HWND hWnd);
HRESULT CreateBlendState();
ID3D11Device *m_pDevice;
ID3D11DeviceContext *m_pDeviceContext;
IDXGISwapChain *m_pSwapChain;
ID3D11RenderTargetView *m_pRenderTargetView;
ID3D11RasterizerState *m_pRasterizerState;
ID3D11Texture2D* m_pDepthStencil; // Òåêñòóðà áóôåðà ãëóáèí
ID3D11DepthStencilView* m_pDepthStencilView; // Îáúåêò âèäà, áóôåð ãëóáèí
ID3D11BlendState* m_pBlendStateTransparency;
bool m_vsync;
};