Ember
A C++ 20 'game engine' built with SDL3 with wide platform support.
polygon.h
Go to the documentation of this file.
1 #pragma once
2 #include "core/component/node.h"
3 
4 
5 class Polygon2D final : public Node2D {
6 public:
7  explicit Polygon2D(const std::vector<glm::vec2>& points, bool fill = false, Color color = Color::WHITE)
8  : _points(points), _color(color), _is_filled(fill) {
9  }
10 
11  void ready() override;
12 
13  void process(double delta_time) override;
14 
15  void draw(Renderer* renderer) override;
16 
17  void set_filled(bool fill);
18 
19 private:
20  std::vector<glm::vec2> _points;
21  Color _color = Color::WHITE;
22  bool _is_filled = false;
23 };
2D Node base class for scene graph.
Definition: node.h:25
Definition: polygon.h:5
void process(double delta_time) override
Definition: polygon.cpp:10
Polygon2D(const std::vector< glm::vec2 > &points, bool fill=false, Color color=Color::WHITE)
Definition: polygon.h:7
void set_filled(bool fill)
Definition: polygon.cpp:29
void draw(Renderer *renderer) override
Definition: polygon.cpp:14
void ready() override
Definition: polygon.cpp:6
Base class for all renderers.
Definition: ember_core.h:109
Color struct.
Definition: engine_structs.h:85
static const Color WHITE
Definition: engine_structs.h:100