-
Notifications
You must be signed in to change notification settings - Fork 0
/
Direct3D.hpp
77 lines (54 loc) · 1.67 KB
/
Direct3D.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef DIRECT3D_HPP
#define DIRECT3D_HPP
#include <d3d11.h>
#include "Globals.hpp" // InitialiseDepthStencilAndView(), CreateViewport()
class Direct3DContext {
private:
IDXGISwapChain* SwapChain;
ID3D11Device* Device;
ID3D11DeviceContext* DeviceContext;
D3D11_RASTERIZER_DESC RasterizerDescription;
ID3D11RasterizerState* RasterizerState;
D3D11_VIEWPORT Viewport;
D3D11_VIEWPORT ShadowMapViewPort;
/* ------------- COMMENTS -------------
Initializes Device, DeviceContext, and SwapChain.
*/
void CreateDirect3DContext(HWND wndHandle);
/* ------------- COMMENTS -------------
Initializes the default Rasterizer with customized settings.
*/
void InitializeRasterizer();
/* ------------- COMMENTS -------------
Initializes the internal viewport with data.
*/
void InitializeViewports();
/* ------------- COMMENTS -------------
Sets the Rasterizer with already initialized data.
*/
void SetRasterizer();
public:
Direct3DContext();
~Direct3DContext();
void ReleaseAll();
/* ------------- COMMENTS -------------
Sets the internal viewport to the Rasterizer stage
(standard viewport for the camera).
*/
void SetStandardViewport();
/* ------------- COMMENTS -------------
Sets the internal viewport to the Rasterizer stage
(viewport for the when creating the high res ShadowMap).
*/
void SetShadowMapViewport();
ID3D11Device* *GetDevice();
ID3D11DeviceContext* *GetDeviceContext();
IDXGISwapChain* *GetSwapChain();
/* ------------- COMMENTS -------------
Initializes Device, DeviceContext, and SwapChain.
Initializes internal Viewport.
Sets internal viewport to the Rasterizer stage in the GPU-pipeline
*/
void Initialize(HWND wndHandle);
};
#endif