forked from Milez213/CityTrial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameHUD.h
62 lines (45 loc) · 1015 Bytes
/
GameHUD.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
//
// GameHUD.h
//
//
// Created by Bryan Bell on 2/9/13.
//
//
#ifndef ____GameHUD__
#define ____GameHUD__
#include <iostream>
#include <string>
#ifdef __APPLE__
#include <OpenGL/gl3.h>
#else
#include <GL/gl.h>
#endif
#include "MStackHelp.h"
#include "ModelManager.h"
#include "HUDShader.h"
using namespace glm;
class GameHUD {
public:
GameHUD();
void prepareShader();
void setColor(vec3 color) { playerColor = color; };
void setScreen(float width, float height);
void drawWin();
void drawLose();
void drawSpeed(float speed);
void drawEnergy(float maxEnergy, float energy, string name);
void drawScore(int score);
void drawTimer(float dt, bool rushed);
protected:
RenderingHelper modelMatrix;
mat4 proj, view;
float hudWidth, hudHeight;
private:
void setOrthographicMatrix();
void setHUDView();
float currentSpeed;
float currentTime;
int currentScore;
vec3 playerColor;
};
#endif /* defined(____GameHUD__) */