ShishGL  1.0
A simple modular cross-platform graphics library
GradeCanvas.hpp
Go to the documentation of this file.
1 /*============================================================================*/
2 #ifndef SHISHGL_GRADECANVAS_HPP
3 #define SHISHGL_GRADECANVAS_HPP
4 /*============================================================================*/
5 #include "GUI.hpp"
6 /*============================================================================*/
7 namespace Sh {
8 
9  class GradeCanvas : public UICanvas {
10  public:
11 
12  explicit GradeCanvas(const Frame& frame)
13  : UICanvas(frame, Color::YELLOW) {
14 
15  static constexpr size_t OFFSET = 20;
16 
17  for (size_t x = OFFSET; x < canvas.size().x - OFFSET; ++x) {
18  for (size_t y = OFFSET; y < canvas.size().y - OFFSET; ++y) {
19  canvas.setPixel({x, y}, Color::RED);
20  }
21  }
22  }
23 
24  };
25 
26 }
27 /*============================================================================*/
28 #endif //SHISHGL_GRADECANVAS_HPP
29 /*============================================================================*/
Sh::GradeCanvas::GradeCanvas
GradeCanvas(const Frame &frame)
Definition: GradeCanvas.hpp:12
Sh::GradeCanvas
Definition: GradeCanvas.hpp:9
GUI.hpp
Sh::Frame
Definition: Frame.hpp:9
Sh::Image::size
const Vector2< size_t > & size() const
Definition: Image.hpp:56
Sh::UICanvas
Definition: UICanvas.hpp:10
Sh::Color::RED
static const Color RED
Definition: Color.hpp:35
Sh
Definition: CoreApplication.hpp:10
Sh::Color
Definition: Color.hpp:9
Sh::UICanvas::canvas
Image canvas
Definition: UICanvas.hpp:21
Sh::Image::setPixel
void setPixel(const Vector2< size_t > &pos, const Color &color)
Definition: Image.hpp:36