-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrenderer.hh
More file actions
55 lines (41 loc) · 846 Bytes
/
Copy pathrenderer.hh
File metadata and controls
55 lines (41 loc) · 846 Bytes
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
#ifndef _GRAVITY_RENDERER_HH_
#define _GRAVITY_RENDERER_HH_
#include "mesh.hh"
#include "camera.hh"
#include "resource-cache.hh"
#include <SDL2/SDL.h>
#include <string>
using namespace std;
enum class TextAnchor {
LEFT,
RIGHT,
CENTER,
TOP,
BOTTOM
};
class Background {
protected:
SDL_Window *window;
ResourceCache::Texture texture;
GLuint vbo;
int lastWindowWidth;
int lastWindowHeight;
void RebuildIfNecessary();
public:
Background(SDL_Window *window, ResourceCache::Texture texture);
virtual ~Background();
void Draw();
};
class Renderer {
protected:
SDL_Window *window;
SDL_GLContext context;
Camera camera;
public:
Renderer(SDL_Window *window);
virtual ~Renderer();
void SetCamera(Camera &camera);
void ClearScreen();
void PresentScreen() const;
};
#endif /* _GRAVITY_RENDERER_HH_ */