Add rectangle drawing utilities

This commit is contained in:
2024-01-14 19:51:18 +00:00
parent 02e4326f4c
commit 0f87945e89
2 changed files with 19 additions and 2 deletions

View File

@@ -10,6 +10,7 @@
typedef struct point point_t;
typedef struct line line_t;
typedef struct triangle triangle_t;
typedef struct rect rect_t;
typedef struct window window_t;
struct point {
@@ -28,6 +29,12 @@ struct triangle {
point_t p2;
};
struct rect {
point_t topleft;
i32 w;
i32 h;
};
struct window {
u64 width;
u64 height;
@@ -52,5 +59,6 @@ void draw_point(const window_t *wnd, point_t p, colour_t colour);
void draw_line(const window_t *wnd, const line_t *ln, colour_t colour);
void draw_triangle(const window_t *wnd, const triangle_t *triangle,
colour_t colour);
void draw_rect(const window_t *wnd, const rect_t *rect, colour_t colour);
#endif // !WINDOW_H