-
Notifications
You must be signed in to change notification settings - Fork 13
/
Game.h
68 lines (53 loc) · 1.43 KB
/
Game.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
#pragma once
#include "DXCore.h"
#include "Mesh.h"
#include "GameEntity.h"
#include "Camera.h"
#include "SimpleShader.h"
#include "Lights.h"
#include "Sky.h"
#include <DirectXMath.h>
#include <wrl/client.h>
#include <vector>
class Game
: public DXCore
{
public:
Game(HINSTANCE hInstance);
~Game();
// Overridden setup and game loop methods, which
// will be called automatically
void Init();
void OnResize();
void Update(float deltaTime, float totalTime);
void Draw(float deltaTime, float totalTime);
private:
// Our scene
std::vector<std::shared_ptr<GameEntity>> entities;
std::shared_ptr<Camera> camera;
// Lights
std::vector<Light> lights;
int lightCount;
bool showPointLights;
// These will be loaded along with other assets and
// saved to these variables for ease of access
std::shared_ptr<Mesh> lightMesh;
std::shared_ptr<SimpleVertexShader> lightVS;
std::shared_ptr<SimplePixelShader> lightPS;
// Texture related resources
Microsoft::WRL::ComPtr<ID3D11SamplerState> samplerOptions;
// Skybox
std::shared_ptr<Sky> sky;
// General helpers for setup and drawing
void LoadAssetsAndCreateEntities();
void GenerateLights();
void DrawPointLights();
// UI functions
void UINewFrame(float deltaTime);
void BuildUI();
void CameraUI(std::shared_ptr<Camera> cam);
void EntityUI(std::shared_ptr<GameEntity> entity);
void LightUI(Light& light);
// Should the ImGui demo window be shown?
bool showUIDemoWindow;
};