-
Notifications
You must be signed in to change notification settings - Fork 0
/
Renderer.h
executable file
·90 lines (78 loc) · 2.31 KB
/
Renderer.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
84
85
86
87
88
89
90
#pragma once
#ifndef RENDERER_H
#define RENDERER_H
#include "DrawableManager.h"
#include "Texture2D.h"
#include "LightManager.h"
#include "Shaders/LightingCompute.h"
class MessageLogger;
class ShaderManager;
class MeshManager;
class Camera;
class FXAAShader;
class LightingShader;
class Generator;
struct RendererSettings {
BOOL wireframe;
DOUBLE cameraspeed;
FLOAT znear;
FLOAT zfar;
BOOL fxaa;
FLOAT schedTime;
BOOL schedStep;
FLOAT tessAmount;
RendererSettings() {
wireframe = FALSE;
cameraspeed = 100000;
zfar = 1000000000.0;
znear = 10.0;
fxaa = 1;
schedTime = 0.15;
schedStep = 0;
tessAmount = 32;
}
};
class Renderer {
public:
Renderer(MessageLogger* mLogger);
~Renderer();
void init();
HRESULT OnD3D11CreateDevice(ID3D11Device* pd3dDevice, const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc );
HRESULT OnD3D11ResizedSwapChain( ID3D11Device* pd3dDevice, const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc );
LRESULT MsgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, bool* pbNoFurtherProcessing,
void* pUserContext );
void OnD3D11FrameRender( ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext, double fTime, float fElapsedTime, void* pUserContext );
void OnFrameMove( double fTime, float fElapsedTime, void* pUserContext );
void OnD3D11DestroyDevice();
void OnExit();
RendererSettings mSettings;
DXGI_SURFACE_DESC mSurfaceDescription;
DrawableManager mDrawableManager;
MessageLogger* mLogger;
ShaderManager* mShaderManager;
LightManager* mLightManager;
MeshManager* mMeshManager;
Camera* mCamera;
FXAAShader* mFXAAShader;
LightingShader* mLightingShader;
LightingCompute* mLightingCompute;
Generator* mGenerator;
Texture2D mProxyTexture;
Texture2D mGBuffer[3];
Depth2D mDepthStencil;
Depth2DDSV mDSV;
Depth2DDSV mDSVRO;
Depth2DSRV mDSSRV;
StructuredBuffer<LightingCSFB> mLightingCSFBSB;
StructuredBuffer<PointLightGPU> mLightListCSSB;
ID3D11DepthStencilState* mDSStateDefault;
ID3D11DepthStencilState* mDSStateStencilWrite;
ID3D11DepthStencilState* mDSStateStencilCull;
ID3D11RasterizerState* mRasterizerStateDefault;
ID3D11RasterizerState* mRasterizerStateWireframe;
PointLight mLightList[1024];
boolean mRecompile;
private:
Renderer(const Renderer& copy);
};
#endif