#pragma once #include #include #include "Color.h" #include "Rectangle.h" class ViewController; class View { public: View(ViewController & vc); virtual ~View(); public: virtual void set_size(unsigned int width, unsigned int height); 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(); };