Simple implementation of polygons, you can create them in the init and draw them

This commit is contained in:
Karma Riuk
2023-03-14 21:46:36 +01:00
parent 7a5bf13575
commit 9fd87b7f29
3 changed files with 61 additions and 2 deletions

28
polygons.h Normal file
View File

@ -0,0 +1,28 @@
#ifndef POLYGONS_H_INCLUDED
#define POLYGONS_H_INCLUDED
// extern ball spaceship;
#include "vec2d.h"
#include <gtk/gtk.h>
#include <vector>
class polygon {
public:
vec2d center;
double angle;
std::vector<vec2d> points;
void draw(cairo_t* cr) const;
};
extern polygon* polygons;
extern uint n_polygons;
extern void polygons_init_state();
extern void polygons_update_state();
// extern void polygon_control (double dx, double dy);
extern void polygons_draw(cairo_t* cr);
#endif