-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUIRenderer.hpp
59 lines (38 loc) · 927 Bytes
/
UIRenderer.hpp
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
#ifndef __UIRENDERER_HPP__
#define __UIRENDERER_HPP__
#include "Utils.hpp"
#include <SDL2/SDL.h>
#include <SDL2/SDL2_gfxPrimitives.h>
#include <cstring>
#include <memory>
#include <map>
namespace ui {
class UIRenderer {
public:
UIRenderer(int width, int height, int argc, char **argv) : _width(width), _height(height), _win(nullptr), _ren(nullptr) {
_Init(argc, argv);
}
~UIRenderer();
void set(const std::string &mac, const utils::Circle &circle) {
_circles[mac] = circle;
}
void _Init(int argc, char **argv);
void drawScene();
void update();
private:
void drawElements();
private:
static void drawSceneStatic() {
_staticThis->drawScene();
}
static UIRenderer *_staticThis;
private:
int _width;
int _height;
std::map<std::string, utils::Circle> _circles;
// SDL stuff.
SDL_Window* _win;
SDL_Renderer* _ren;
};
} // namespace ui
#endif // __UIRENDERER_HPP__