blob: 616257118fe2b01a6afe39d65bb1b6e03acd79ab (
plain)
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
|
#pragma once
#include <SDL2/SDL.h>
#include <thread>
#include <vector>
#include <string>
#include "Color.h"
#include "Rectangle.h"
#include "ViewController.h"
class View {
public:
View(Museum & m);
virtual ~View();
public:
virtual void window_size(unsigned int width, unsigned int height);
virtual void dialog_file(void(*callback)(std::vector<std::string> files, void* data), void* data);
virtual void fill_rect(Rectangle r, Color c);
virtual void draw_rect(Rectangle r, Color c, unsigned border_width);
private:
virtual void draw_begin();
virtual void draw_end();
virtual void window_init();
virtual void window_deinit();
public:
bool open = true;
private:
ViewController controller;
private:
unsigned int width = 0, height = 0;
SDL_Window * window = nullptr;
SDL_Renderer * renderer = nullptr;
private:
std::thread * worker = nullptr;
void work();
};
|