-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrenderer.hpp
More file actions
50 lines (42 loc) · 1.15 KB
/
renderer.hpp
File metadata and controls
50 lines (42 loc) · 1.15 KB
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
#ifndef _RENDERER_HPP_
#define _RENDERER_HPP_
#include "vector3.hpp"
#include <GL/glew.h>
#include "sprite.hpp"
#include <memory>
class Renderer
{
private:
int id;
Vector3 eye;
Vector3 center;
bool firstRun;
std::vector<std::shared_ptr<Sprite> > sprites;
float nativeHeight; // How far the camera is normally
public:
Renderer();
~Renderer();
void moveCamera(float coord_x, float coord_y, float coord_z);
void clearScreen();
void renderBackground();
void renderMain();
void renderForeground();
void render();
void renderObject( GLenum primitiveType, int indiceCount, GLenum datatype,
std::vector<int> indices, std::vector<double> vertices,
std::vector<double> normals, Vector3 location,
float rotation, float scale);
void calculateLights();
void moveForwards();
void moveBackwards();
void moveRight();
void moveLeft();
void panLeft();
void panRight();
void panUp();
void panDown();
Vector3 getCameraLocation() { return eye; }
float getNativeHeight() { return nativeHeight; }
};
extern Renderer renderer;
#endif