-
Notifications
You must be signed in to change notification settings - Fork 1
/
VPXDisplayServer.h
53 lines (43 loc) · 1.31 KB
/
VPXDisplayServer.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
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <string>
#include <vector>
using std::string;
using std::vector;
struct VPXDisplay {
SDL_Window* pWindow;
SDL_Renderer* pRenderer;
SDL_Texture* pTexture;
int x;
int y;
int width;
int height;
};
class VPXDisplayServer
{
public:
VPXDisplayServer();
~VPXDisplayServer();
static void Forward(struct mg_http_message *hm, struct mg_connection *c);
static void HandleEvent(struct mg_connection *c, int ev, void *ev_data, void *fn_data);
static void HandleEvent2(struct mg_connection *c, int ev, void *ev_data, void *fn_data);
int Start();
void SetBasePath(const string& path) { m_szBasePath = path; }
private:
void LoadINI();
int OpenDisplay(const string& szName, VPXDisplay* pDisplay);
void CloseDisplay(VPXDisplay* pDisplay);
void RenderDisplay(VPXDisplay* pDisplay);
void Update(struct mg_connection *c, void *ev_data);
void Reset(struct mg_connection *c, void *ev_data);
void Capture(struct mg_connection *c, void *ev_data);
void CaptureES(struct mg_connection *c, void *ev_data);
bool ProcessPNG(const std::string& filename);
VPXDisplay* m_pBackglassDisplay;
VPXDisplay* m_pDMDDisplay;
string m_szCachePath;
string m_szBasePath;
string m_szESUrl;
int m_tableWidth;
int m_tableHeight;
};