-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameEngine.h
73 lines (54 loc) · 1.48 KB
/
GameEngine.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
#pragma once
#include <vector>
#include "Shader.h"
#include "Camera.h"
class Player; // Forward declaration of Player class.
class TexturedLandscape; // Forward declaration of Landscape class.
class SkyBox; // Forward declaration of Landscape class.
class Weapon; // Forward declaration of Weapon class.
enum EntityType {LANDSCAPE, BULLET, CHAOS_MARINE, VARGE};
class GameEngine
{
public:
GameEngine(void);
bool init();
void prepare(float dt);
void render();
void shutdown();
void onResize(int width, int height);
void processInputs();
void processInput();
void processMouseInput();
void spawnEntity(EntityType type, Vector3 position, Vector3 velocity, Vector3 acceleration);
void setupPerspectiveProj();
void setupOrthoProj();
int getWidth();
int getHeight();
Camera* getCamera();
Vector3 getCameraPos();
~GameEngine(void);
//Shader programs
ShaderProgram *m_basicProgram;
ShaderProgram *m_modelProgram;
ShaderProgram *m_hudProgram;
ShaderProgram *m_skyboxProgram;
ShaderProgram *m_particleProgram;
private:
//Entity vectors
std::vector<Object*> m_objects;
std::vector<Camera*> m_cameras;
std::vector<Object*> m_HUD;
//Weapon object
Weapon* m_weapon;
//Player object
Player* m_player;
//Landscape object
TexturedLandscape* m_landscape;
//Skybox object
SkyBox* m_skybox;
GLfloat lightAngle;
std::map<EntityType, DWORD> m_lastSpawnTime;
int m_width;
int m_height;
static int colCount;
};