BuGUI
BUtton Grid User Interface
Loading...
Searching...
No Matches
painter.hpp
1#pragma once
2#include "base_painter.hpp"
3#include <geometry/rectangle.hpp>
4
5namespace bugui
6{
7struct base_controller;
9struct painter final
10 : base_painter
11 , rectangle
12{
13 explicit painter(int width, int height);
14
15 ~painter() { delete[] grid; }
16
17 void reset();
18 void set(int x, int y);
19 void ofset(int x, int y);
20 bool bound_at_offset(rectangle* bounds);
21
22 void set_paint_over(bool value);
23 void draw_cell(int x, int y);
24 void draw_line(int x1, int y1, int x2, int y2);
25
26 color read_clear(int x, int y);
27
28private:
29 const int x_bound;
30 const int y_bound;
31 const int max_x;
32 const int max_y;
33
34 int horizontal_ofset{0};
35 int vertical_ofset{0};
36
37 void set_cell(int x, int y);
38
39 bool paint_over{false};
40 color* grid;
41};
42
43} // namespace bugui
Serves as the root of the widget tree. Also provides access to buttons componnents.
Definition base_controller.hpp:10
Generic colour class holding RGBA values of a primary and a secondary colour. The blinking and pulsin...
Definition color.hpp:12
Provides the geometric structure of widgets.
Definition rectangle.hpp:8