aboutsummaryrefslogtreecommitdiff
path: root/View.h
blob: c8b21331c48a6948eb5740fee061c5e4265e9df7 (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
#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 draw_rect(Rectangle r, Color c);

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();
};