-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApplicationClass.hpp
170 lines (127 loc) · 4.08 KB
/
ApplicationClass.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#ifndef APPLICATIONCLASS_HPP
#define ApplicationClass_HPP
#include "GraphicsClass.hpp"
#include "InputClass.hpp"
#include "Direct3D.hpp"
#include "objLoader.hpp"
#include "Camera.hpp"
#include "TimerClass.hpp"
#include "ObjectHandlerClass.hpp"
#include <d3d11.h>
#include <d3dcompiler.h>
#include <DirectXMath.h>
#pragma comment (lib, "d3d11.lib")
#pragma comment (lib, "d3dcompiler.lib")
// NON-CLASS FUNCTION
// LRESULT CALLBACK WindowsProcedure(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
class ApplicationClass {
private:
MSG msg;
HWND wndHandle;
GraphicsClass GraphicsManager;
ObjectHandlerClass ObjectManager;
InputClass InputManager;
TimerClass GameTimer;
void InitiateWindow(HINSTANCE hInstance, LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM));
bool HoverCamActivationStatus = false;
static ApplicationClass* SelfPtr;
public:
ApplicationClass();
~ApplicationClass();
/* ------------- COMMENTS -------------
Releases GraphicsClass
--- Releases Direct3DContext
--- --- Releases SwapChain
--- --- Releases Device
--- --- Releases DeviceContext
--- Releases BasicShader
--- --- Releases VertexShader
--- --- Releases GeometryShader
--- --- Releases PixelShader
--- --- Releases BackBufferRTV
--- --- Releases DepthStencil
--- --- Releases DepthStencilView
--- Releases ConstantBuffer
Destroys internal windowHandle
*/
void Shutdown();
/* ------------- COMMENTS -------------
Initializes Window.
Initializes Input,
--- Imports Object Files
Initializes Graphics,
--- Initializes Direct3DContext
--- --- Creates 3DContext
--- --- Creates Viewport
--- --- Creates DepthStencilView
--- Initializes BasicShader
--- --- Creates VertexShader
--- --- Creates GeometryShader
--- --- Creates PixelShader
--- Initializes ConstantBuffers
--- --- Initializes ConstantMatrices
--- --- Creates & Sets ConstantBuffers [GS]
*/
void Initialize(HINSTANCE hInstance);
/* ------------- COMMENTS -------------
Pulls object- & calculation-data from InputManager's earlier called 'importObjFile'
and sets these into Graphics->ObjectManager's respective Vertex/Index-Buffers
*/
void SetObjectData();
/* ------------- COMMENTS -------------
*/
void CreateQuadTree();
/* ------------- COMMENTS -------------
Checks which leafnodes the frustum relies in through plane/plane-intersections.
Checks which objectClones in these leafnodes who rely in the frustum with p/p-intersection.
Only render the objects which can be "seen" by the frustum.
I
[OBS: NEEDS QUAD TREE TO BE CREATED IN ADVANCE]
*/
void FrustumCull();
void SetHeightMapData();
/* ------------- COMMENTS -------------
Sets the LightShaders internal RenderTargetView to be the main
BackBufferRTV, which is displayed by the window.
*/
void SetMainBackBufferRTV();
HWND GetWNDHandle();
MSG *GetInputMessage();
/* ------------- COMMENTS -------------
Updates CursorMovement with new cursor coordinates based on the difference between new & old coordinates.
Then updates the camera based on keyboard input through CharacterMessage and the updated cursor coordinates.
*/
void UpdateCamera();
/* ------------- COMMENTS -------------
Renders the ShadowMap using the ShadowMapping pipeline.
This is stored into a Texture2D that is later used
during the deferred rendering stage.
*/
void RenderShadowMap();
/* ------------- COMMENTS -------------
Renders using Deferred Rendering.
*/
void RenderDeferredAll();
/* ------------- COMMENTS -------------
Renders all the 'falling snow' particles. This is
done after/'on top' of the deferred rendering and
as such is completely independant.
*/
void RenderParticles();
/* ------------- COMMENTS -------------
Swaps front(window)-buffer & back-buffer
*/
void Present();
/* ------------- COMMENTS -------------
*/
void CheckPicking();
/*
Switches between displaying from the MainCamera & HoverCamera,
by switching the View&Projection matrices in the ConstantBuffer.
*/
void SwitchCamera();
static LRESULT CALLBACK WindowsProcedure(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
// GET FUNCTIONS
TimerClass* getTimer();
};
#endif