-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenderClass.h
83 lines (58 loc) · 1.92 KB
/
RenderClass.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
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
78
79
80
81
82
83
#ifndef __H__RenderClass
#define __H__RenderClass
#include "include.h"
class Model;
class ModelLoader;
class Camera;
class Input;
class World;
class RenderClass
{
public:
RenderClass(HWND);
void SetWorld(World* w) { world = w; }
void RenderFrame();
Model* GetModel(int index) { return modelVector[index]; }
void AddModel(Model* mod) { modelVector.push_back(mod); modelVector.shrink_to_fit(); }
void GetDevice(ComPtr<ID3D11Device>* dev) { device.As(dev); }
void GetDeviceContext(ComPtr<ID3D11DeviceContext>* devcon) { deviceContext.As(devcon); }
void GetRasDesc(D3D11_RASTERIZER_DESC* rasDesc) { rasState->GetDesc(rasDesc); }
void GetSamplerState(ComPtr<ID3D11SamplerState>* sample) { samplerState.As(sample); }
ModelLoader* GetModelLoader() { return modLoad; }
Input* GetInput() { return inp; }
Camera* GetCamera() { return cam; }
int ModelCount() { return modelVector.size(); }
World* GetWorld() { return world; }
void SetFillMode(D3D11_FILL_MODE);
void CycleCellDisplayMode()
{
cellDisplayMode = (cellDisplayMode + 1) % Filter_Total_Count;
}
void SetCellDisplayMode(int newMode)
{
cellDisplayMode = newMode % Filter_Total_Count;
}
short GetCellDisplayMode() { return cellDisplayMode; }
~RenderClass();
private:
HWND hwnd;
vector<Model*> modelVector;
RECT size;
ComPtr<ID3D11Device> device;
ComPtr<ID3D11DeviceContext> deviceContext;
ComPtr<IDXGISwapChain> swapChain;
ComPtr<ID3D11RenderTargetView> backbuffer;
ComPtr<ID3D11DepthStencilState> depthStencilState;
ComPtr<ID3D11DepthStencilView> depthStencilView;
ComPtr<ID3D11InputLayout> inputLayout;
ComPtr<ID3D11VertexShader> vertexShader;
ComPtr<ID3D11PixelShader> pixelShader;
ComPtr<ID3D11SamplerState> samplerState;
ComPtr<ID3D11RasterizerState> rasState;
Camera* cam = nullptr;
Input* inp = nullptr;
ModelLoader* modLoad = nullptr;
short cellDisplayMode = 0; //0 is normal Cell texture mode, 1 is Dna mode
World* world = nullptr;
};
#endif